/* ============================================
   PERFORMANCE MARKET SYSTEM - Light Theme Design System
   Clean, Professional, Fast-to-read UI
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ==================== CSS Variables ==================== */
:root {
    /* Primary palette - Electric blue */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;

    /* Background tones */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-input: #ffffff;
    --bg-input-focus: #ffffff;

    /* Text */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-dark: #000000;

    /* Status colors (Text & Background Combos) */
    --status-must-try: #15803d;
    --status-must-try-bg: #dcfce7;
    --status-can-try: #b45309;
    --status-can-try-bg: #fef3c7;
    --status-already-running: #1d4ed8;
    --status-already-running-bg: #dbeafe;
    --status-no: #b91c1c;
    --status-no-bg: #fee2e2;
    --status-other: #374151;
    --status-other-bg: #f3f4f6;
    --status-approved: #15803d;
    --status-approved-bg: #dcfce7;
    --status-rejected: #b91c1c;
    --status-rejected-bg: #fee2e2;
    --status-hold: #b45309;
    --status-hold-bg: #ffedd5;

    /* Lifecycle colors */
    --stage-research: #6d28d9;
    --stage-testing: #b45309;
    --stage-ads-running: #1d4ed8;
    --stage-scaling: #15803d;
    --stage-dead: #374151;

    /* Borders */
    --border: #e5e7eb;
    --border-light: #f3f4f6;

    /* Shadows - Soft and clean */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.02);

    /* Spacing */
    --sidebar-width: 260px;
    --topbar-height: 64px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

/* ==================== Reset ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==================== Login Page ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.login-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.login-card .logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.5px;
}

.login-card .logo p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ==================== Form Elements ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
    box-shadow: var(--shadow-sm);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2), 0 2px 4px -2px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid #d1d5db;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: #94a3b8;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ==================== Dashboard Layout ==================== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.sidebar-header .user-info {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.sidebar-header .user-role {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.role-admin { background: #fee2e2; color: #b91c1c; }
.role-manager { background: #fef3c7; color: #b45309; }
.role-staff { background: #dbeafe; color: #1d4ed8; }

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-section {
    padding: 8px 24px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: #111827;
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary-hover);
    font-weight: 600;
    border-left-color: var(--primary);
}

.nav-item .icon {
    font-size: 18px;
    width: 22px;
    text-align: center;
    filter: grayscale(1) opacity(0.5);
    transition: all var(--transition-fast);
}

.nav-item:hover .icon,
.nav-item.active .icon {
    filter: grayscale(0) opacity(1);
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.logout-btn {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid #fca5a5;
    border-radius: var(--radius-sm);
    color: #ef4444;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

/* Main content area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 50;
}

.topbar h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Page content */
.page-content {
    padding: 32px;
    overflow-x: hidden;
}

/* ==================== Notification Bell ==================== */
.notif-bell-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}
.notif-bell-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.notif-bell-btn .notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
    animation: notifPop 0.3s ease;
}
@keyframes notifPop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Notification dropdown */
/* Old dropdown (kept for backward compat) */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 8px 24px rgba(0,0,0,0.06);
    z-index: 1000;
    overflow: hidden;
    animation: drpFadeIn 0.15s ease;
}

/* Right-side slide panel */
.notif-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    background: #ffffff;
    border-left: 1px solid #e5e7eb;
    box-shadow: -8px 0 40px rgba(0,0,0,0.12);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.notif-panel.notif-panel-open {
    transform: translateX(0);
}

/* Responsive */
@media (max-width: 480px) {
    .notif-panel { width: 100vw; }
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f3f4f6;
    background: #fafafa;
}
.notif-dropdown-header h4 {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}
.notif-mark-all-btn {
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}
.notif-mark-all-btn:hover { text-decoration: underline; }

.notif-list {
    flex: 1;
    overflow-y: auto;
    max-height: none;
}
.notif-item {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #f9fafb;
    cursor: pointer;
    transition: background var(--transition-fast);
    align-items: flex-start;
}
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #eff6ff; }
.notif-item.unread:hover { background: #dbeafe; }
.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 6px;
}
.notif-item.read .notif-dot { background: transparent; }
.notif-item-body { flex: 1; }
.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 3px;
    line-height: 1.4;
}
.notif-item-sub {
    font-size: 12px;
    color: var(--text-muted);
}
.notif-item-time {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}
.notif-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.notif-empty .notif-empty-icon { font-size: 32px; margin-bottom: 8px; }

/* Status colors in notification */
.notif-status-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.nstatus-must_run  { background: #dcfce7; color: #15803d; }
.nstatus-can_run   { background: #fef3c7; color: #b45309; }
.nstatus-running   { background: #dbeafe; color: #1d4ed8; }
.nstatus-rejected  { background: #fee2e2; color: #b91c1c; }
.nstatus-closed    { background: #f3f4f6; color: #374151; }
.nstatus-hold      { background: #ffedd5; color: #c2410c; }
.nstatus-pending   { background: #f3f4f6; color: #6b7280; }

/* ==================== Review Popup Alert ==================== */
.review-alert-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 360px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    padding: 18px 20px;
    z-index: 2000;
    animation: reviewAlertIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Inter', sans-serif;
}
@keyframes reviewAlertIn {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
.review-alert-popup.slide-out {
    animation: reviewAlertOut 0.3s ease forwards;
}
@keyframes reviewAlertOut {
    to { transform: translateX(120%); opacity: 0; }
}
.ral-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.ral-icon { font-size: 22px; }
.ral-title {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    flex: 1;
}
.ral-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #9ca3af;
    line-height: 1;
    padding: 0 2px;
}
.ral-close:hover { color: #374151; }
.ral-product {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}
.ral-detail {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.ral-remark {
    margin-top: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 12px;
    color: #374151;
    font-style: italic;
}
.ral-view-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 16px;
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    font-family: 'Inter', sans-serif;
    transition: background var(--transition-fast);
}
.ral-view-btn:hover { background: var(--primary-hover); color: #fff; }

/* ==================== Bottom Notification Bar ==================== */
.notif-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 997;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, #1e40af, #7c3aed);
    color: #fff;
    cursor: pointer;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
    font-family: 'Inter', -apple-system, sans-serif;
}

.notif-bottom-bar-show {
    transform: translateY(0);
}

.notif-bb-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

.notif-bb-pulse {
    width: 10px;
    height: 10px;
    background: #fbbf24;
    border-radius: 50%;
    animation: bbPulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes bbPulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.5); }
    50%      { opacity: 0.7; transform: scale(1.3); box-shadow: 0 0 0 8px rgba(251, 191, 36, 0); }
}

.notif-bb-icon {
    font-size: 20px;
    animation: bbShake 3s ease-in-out infinite;
}

@keyframes bbShake {
    0%, 90%, 100% { transform: rotate(0deg); }
    92% { transform: rotate(15deg); }
    94% { transform: rotate(-15deg); }
    96% { transform: rotate(10deg); }
    98% { transform: rotate(-5deg); }
}

.notif-bb-text {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.notif-bb-text strong {
    font-weight: 700;
    color: #fbbf24;
}

.notif-bb-close {
    font-size: 18px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s;
    margin-left: 16px;
    flex-shrink: 0;
}

.notif-bb-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

/* Hover effect on bottom bar */
.notif-bottom-bar:hover {
    background: linear-gradient(135deg, #1d4ed8, #6d28d9);
}

/* ==================== Cards ==================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card.blue::before { background: #3b82f6; }       /* Total Products, Active */
.stat-card.purple::before { background: #a855f7; }     /* Today's Submissions */
.stat-card.orange::before { background: #f97316; }     /* Pending Review */
.stat-card.yellow::before { background: #eab308; }     /* Pending Verdict */
.stat-card.green::before { background: #10b981; }      /* Approved, Sales, Rev, Profit */
.stat-card.red::before { background: #ef4444; }        /* Rejected */
.stat-card.amber::before { background: #f59e0b; }      /* On Hold */

/* Override specific bright green for Must Try */
.stat-card.must-try::before { background: #22c55e; } 
/* As the JS may set specific classes like green, orange, red, yellow, blue, purple, etc, 
we map existing JS classes to standard light theme colors. */

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== Data Table ==================== */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    background: #ffffff;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 14px;
    padding-left: 36px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-fast);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.filter-select {
    padding: 8px 32px 8px 12px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ===== DateRangePicker — FB Ads Manager Style ===== */

/* Trigger button */
.drp-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}
.drp-trigger-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.drp-trigger-btn.drp-trigger-active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 500;
}
.drp-cal-icon { font-size: 14px; }

/* Popup container */
.drp-popup {
    position: absolute;
    z-index: 9999;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 8px 24px rgba(0,0,0,0.08);
    min-width: 820px;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    animation: drpFadeIn 0.15s ease;
}
@keyframes drpFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Inner layout */
.drp-inner {
    display: flex;
    min-height: 400px;
}

/* Left — Presets */
.drp-presets {
    width: 210px;
    flex-shrink: 0;
    border-right: 1px solid #f3f4f6;
    padding: 20px 0 20px;
    background: #fafafa;
}
.drp-presets-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #9ca3af;
    padding: 0 20px 12px;
}
.drp-preset-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    transition: background var(--transition-fast);
    border-left: 3px solid transparent;
}
.drp-preset-row:hover {
    background: #f0f4ff;
    color: var(--primary);
}
.drp-preset-row.drp-preset-active {
    background: #eff6ff;
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}
.drp-preset-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}
.drp-preset-dot.dot-active {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* Right panel */
.drp-right {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Calendar row */
.drp-cal-row {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 20px 16px 0;
    flex: 1;
}

/* Nav buttons */
.drp-nav-btn {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 6px;
    transition: all var(--transition-fast);
    line-height: 1;
}
.drp-nav-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

/* Calendars side by side */
.drp-calendars {
    display: flex;
    gap: 24px;
    flex: 1;
}
.drp-calendar {
    flex: 1;
}

/* Month name */
.drp-cal-month {
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    padding-bottom: 12px;
}

/* Calendar grid: 7 col */
.drp-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
}
.drp-cal-dayname {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    padding: 4px 0 8px;
    text-transform: uppercase;
}
.drp-cal-day {
    text-align: center;
    padding: 7px 2px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.1s;
    position: relative;
    z-index: 1;
}
.drp-cal-day:not(.empty):hover {
    background: #dbeafe;
    color: var(--primary);
    font-weight: 600;
}
.drp-cal-day.empty { cursor: default; }

/* Range state */
.drp-cal-day.drp-start,
.drp-cal-day.drp-end {
    background: var(--primary) !important;
    color: #fff !important;
    font-weight: 700;
    border-radius: 6px;
}
.drp-cal-day.drp-in-range {
    background: #dbeafe;
    color: var(--primary);
    border-radius: 0;
}

/* Footer */
.drp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
    gap: 16px;
}
.drp-footer-info { flex: 1; }
.drp-range-text {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}
.drp-tz {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}
.drp-footer-btns {
    display: flex;
    gap: 10px;
}
.drp-btn-cancel {
    padding: 8px 20px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-fast);
}
.drp-btn-cancel:hover { background: #f9fafb; border-color: #9ca3af; }
.drp-btn-apply {
    padding: 8px 24px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-fast);
}
.drp-btn-apply:hover { background: var(--primary-hover); }


.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #ffffff;
}

.data-table thead {
    background: #f8fafc;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text-primary);
}

.data-table tbody tr:nth-child(even) {
    background: #fcfcfd;
}

.data-table tbody tr:hover {
    background: #f1f5f9;
}

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

/* Product link styling */
.link-pill {
    display: inline-block;
    padding: 4px 10px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #4f46e5;
    margin: 2px;
    transition: all var(--transition-fast);
}

.link-pill:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

/* ==================== Status Badges ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-must-try { background: var(--status-must-try-bg); color: var(--status-must-try); border: 1px solid #bbf7d0; }
.badge-can-try { background: var(--status-can-try-bg); color: var(--status-can-try); border: 1px solid #fde68a; }
.badge-already-running { background: var(--status-already-running-bg); color: var(--status-already-running); border: 1px solid #bfdbfe; }
.badge-no { background: var(--status-no-bg); color: var(--status-no); border: 1px solid #fecaca; }
.badge-other { background: var(--status-other-bg); color: var(--status-other); border: 1px solid #e5e7eb; }
.badge-approved { background: var(--status-approved-bg); color: var(--status-approved); border: 1px solid #bbf7d0; }
.badge-rejected { background: var(--status-rejected-bg); color: var(--status-rejected); border: 1px solid #fecaca; }
.badge-hold { background: var(--status-hold-bg); color: var(--status-hold); border: 1px solid #fed7aa; }

/* Lifecycle badges */
.badge-research { background: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.badge-testing { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-ads-running { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-scaling { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-dead { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }

.badge-pending {
    background: #ffffff;
    color: var(--text-muted);
    border: 1px dashed var(--text-muted);
}

/* ==================== Modal ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #4b5563;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: #e5e7eb;
    color: #111827;
}

/* ==================== Toast Notifications ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: white;
    min-width: 280px;
    animation: toastSlideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
}

.toast-success { background: #10b981; }
.toast-error { background: #ef4444; }
.toast-warning { background: #f59e0b; }
.toast-info { background: #3b82f6; }

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==================== Empty States ==================== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

/* ==================== Tabs ==================== */
.tabs {
    display: flex;
    gap: 4px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    width: fit-content;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.tab {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    border: none;
    background: transparent;
}

.tab.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.tab:hover:not(.active) {
    color: var(--text-primary);
}

/* ==================== Loading Spinner ==================== */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* For dark context spinner */
.page-loading .spinner {
    border: 2px solid #e5e7eb;
    border-top-color: var(--primary);
    width: 24px;
    height: 24px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row, .form-row-3 {
        grid-template-columns: 1fr;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar {
        padding: 0 16px;
    }

    .page-content {
        padding: 20px;
    }
}

/* ==================== Utility Classes ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.hidden { display: none !important; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

/* ============================================
   CHALLENGE TABLE — Excel-like Sales Grid
   ============================================ */

/* Header bar */
.ct-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.ct-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.ct-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Summary mini cards */
.ct-summary-cards {
    display: flex;
    gap: 12px;
}

.ct-mini-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.ct-mini-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.ct-mini-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.ct-mini-green { border-top: 3px solid #15803d; }
.ct-mini-red { border-top: 3px solid #b91c1c; }
.ct-mini-blue { border-top: 3px solid #2563eb; }

/* Progress bar */
.ct-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.ct-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Table wrapper */
.ct-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: auto;
    box-shadow: var(--shadow-md);
    max-height: calc(100vh - 280px);
}

/* Core table */
.ct-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-family: 'Inter', -apple-system, sans-serif;
}

.ct-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.ct-header-cell {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 120px;
}

.ct-col-store {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 12px;
}

.ct-col-user {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 11px;
}

/* Sticky first column */
.ct-sticky-col {
    position: sticky;
    left: 0;
    z-index: 5;
    background: #f8fafc;
    min-width: 80px;
    font-weight: 600;
}

.ct-table thead .ct-sticky-col {
    z-index: 15;
}

/* Data cells */
.ct-cell {
    border: 1px solid #e5e7eb;
    padding: 6px 10px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background 0.1s;
    height: 36px;
    white-space: nowrap;
}

.ct-cell:hover {
    background: #eff6ff;
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.ct-date-cell {
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    cursor: default;
    min-width: 70px;
}

/* Cell color coding */
.ct-cell-high {
    background: #dcfce7;
    color: #15803d;
    font-weight: 600;
}

.ct-cell-mid {
    background: #fefce8;
    color: #854d0e;
}

.ct-cell-low {
    background: #fee2e2;
    color: #b91c1c;
}

.ct-cell-empty {
    background: #f9fafb;
    color: #d1d5db;
}

.ct-cell-removed {
    background: #f3f4f6;
    color: #9ca3af;
    text-decoration: line-through;
    cursor: default;
}

/* Total column */
.ct-total-col {
    background: #f0fdf4 !important;
    min-width: 120px;
}

/* Inline edit input */
.ct-cell-input {
    width: 100%;
    border: none;
    outline: none;
    background: white;
    font-size: 13px;
    font-family: inherit;
    text-align: right;
    padding: 2px 4px;
    font-variant-numeric: tabular-nums;
}

/* Footer totals */
.ct-footer-cell {
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    text-align: right;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.ct-table tfoot {
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.ct-table tfoot .ct-sticky-col {
    z-index: 15;
    background: #f1f5f9;
}

/* Removed row */
.ct-row-removed {
    opacity: 0.5;
}

.ct-row-removed .ct-sticky-col {
    text-decoration: line-through;
}

/* Remove button */
.ct-remove-btn {
    background: none;
    border: 1px solid #e5e7eb;
    color: #9ca3af;
    cursor: pointer;
    font-size: 12px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ct-remove-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

/* Restore button (for removed days) */
.ct-restore-btn {
    background: none;
    border: 1px dashed #d1d5db;
    color: #9ca3af;
    cursor: pointer;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.ct-restore-btn:hover {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
    border-style: solid;
}

/* Small spinner for cells */
.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Challenge dashboard stat breakdown */
.ct-stat-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.ct-stat-breakdown-item:last-child {
    border-bottom: none;
}

.ct-stat-breakdown-name {
    font-weight: 500;
    color: var(--text-primary);
}

.ct-stat-breakdown-val {
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Button small variants */
.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-danger {
    background: #b91c1c;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #991b1b;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    vertical-align: middle;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #d1d5db;
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #15803d;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Summary cards row */
.ct-summary-cards {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Data Lock — Locked rows */
.ct-row-locked .ct-cell {
    cursor: not-allowed;
}

.ct-row-locked .ct-sticky-col {
    color: #9ca3af;
}

.ct-cell-locked {
    background: #f9fafb !important;
    position: relative;
}

.ct-cell-locked::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(0,0,0,0.02) 8px,
        rgba(0,0,0,0.02) 16px
    );
    pointer-events: none;
}

/* Today row highlight */
.ct-row-today {
    background: #eff6ff !important;
}

.ct-row-today .ct-sticky-col {
    background: #dbeafe !important;
    color: #1d4ed8;
    font-weight: 700;
}

.ct-row-today .ct-cell {
    background: #eff6ff;
}

.ct-today-badge {
    display: inline-block;
    background: #2563eb;
    color: white;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Challenge History table */
.ct-history-card {
    margin-top: 24px;
}

/* ==================== Collapsible Sidebar Sections ==================== */
.nav-section {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.nav-section::after {
    content: '▾';
    font-size: 10px;
    color: #9ca3af;
    transition: transform var(--transition-fast);
}

.nav-section.collapsed::after {
    transform: rotate(-90deg);
}

.nav-section-items {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease;
}

.nav-section-items.collapsed {
    max-height: 0;
}

/* ==================== Status History Trail ==================== */
.status-history-trail {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.history-entry {
    display: flex;
    flex-direction: column;
    padding: 4px 8px;
    background: #f8fafc;
    border-left: 2px solid #e5e7eb;
    border-radius: 0 4px 4px 0;
    font-size: 10px;
    line-height: 1.3;
}

.history-role {
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
    font-size: 9px;
    letter-spacing: 0.5px;
}

.history-status {
    font-weight: 600;
    color: #111827;
    font-size: 11px;
}

.history-remark {
    color: #374151;
    font-size: 11px;
    font-style: italic;
}

.history-by {
    color: #9ca3af;
    font-size: 9px;
}

/* ==================== Product Detail Page ==================== */
.pd-page {
    max-width: 1200px;
    margin: 0 auto;
}

/* Clickable product name in tables */
.pd-product-link {
    color: var(--primary) !important;
    text-decoration: none;
    transition: color 0.15s;
}

.pd-product-link:hover {
    color: var(--primary-hover) !important;
    text-decoration: underline;
}

.pd-back {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.pd-date {
    color: var(--text-muted);
    font-size: 13px;
}

.pd-header {
    margin-bottom: 28px;
}

.pd-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.pd-title {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 8px;
}

.pd-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.pd-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pd-header-right {
    text-align: right;
    flex-shrink: 0;
}

.pd-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.pd-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pd-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.pd-stat-value {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.pd-remark {
    font-style: italic;
    color: var(--text-secondary) !important;
    font-weight: 400 !important;
}

/* Section heading */
.pd-section {
    margin-bottom: 32px;
}

.pd-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.pd-section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Phone Frame Grid */
.pd-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ── Paired Link + Ad layout ── */
.pd-pairs-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.pd-pair {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px 24px 24px;
}
.pd-pair-num {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary);
    margin-bottom: 14px;
}
.pd-pair-cols {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: center;
}
.pd-pair-divider {
    font-size: 18px;
    color: #d1d5db;
    padding: 0 10px;
    align-self: center;
    flex-shrink: 0;
    margin-top: 30px;
}
.pd-pair-col {
    width: 280px;
    flex-shrink: 0;
}
.pd-pair-col-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: #d1d5db;
    font-size: 13px;
    border: 2px dashed #e5e7eb;
    border-radius: 10px;
}
.pd-pair-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.pd-pair-col-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
/* Link Card (replaces iframe — reliable across all sites) */
.pd-link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}
.pd-link-card:hover {
    box-shadow: var(--shadow-md);
}
.pd-link-card-icon img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: block;
}
.pd-link-card-info {
    flex: 1;
    min-width: 0;
}
.pd-link-card-domain {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pd-link-card-url {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Big open button below phone frame */
.pd-frame-open-btn {
    display: block;
    width: 100%;
    max-width: 260px;
    margin: 10px auto 0;
    padding: 9px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    text-align: center;
    transition: background var(--transition-fast);
}
.pd-frame-open-btn:hover {
    background: var(--primary-hover);
}

.pd-link-card-btn {

    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}
.pd-link-card-btn:hover {
    background: var(--primary-hover);
    color: #ffffff;
}

.pd-ad-card-pair {

    /* reset card margin so it fits in the col */
    margin: 0 !important;
}

.pd-phone-frame {
    background: #1a1a2e;
    border-radius: 28px;
    padding: 10px;
    position: relative;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.08) inset;
    transition: transform 0.2s ease;
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
}

.pd-phone-frame:hover {
    transform: translateY(-3px);
}

.pd-phone-notch {
    width: 80px;
    height: 6px;
    background: #2d2d44;
    border-radius: 3px;
    margin: 0 auto 8px;
}

.pd-phone-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #8b8ba7;
}

.pd-open-link {
    color: #60a5fa !important;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.pd-open-link:hover {
    color: #93c5fd !important;
}

.pd-phone-screen {
    position: relative;
    width: 100%;
    height: 340px;
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
}

.pd-iframe-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 13px;
    z-index: 1;
}

.pd-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: pdSpin 0.8s linear infinite;
}

@keyframes pdSpin {
    to { transform: rotate(360deg); }
}

.pd-iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: relative;
    z-index: 2;
}

.pd-phone-url {
    padding: 8px;
    font-size: 10px;
    color: #6b6b8a;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ad Cards Grid */
.pd-ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

.pd-ad-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.pd-ad-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pd-ad-label {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pd-platform-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pd-fb { background: #e7f0ff; color: #1877f2; }
.pd-ig { background: #fce7f3; color: #e4405f; }
.pd-yt { background: #fee2e2; color: #ff0000; }
.pd-pin { background: #fce7e7; color: #e60023; }
.pd-tt { background: #f0f0f0; color: #010101; }
.pd-vid { background: #dcfce7; color: #15803d; }
.pd-web { background: #f3f4f6; color: #6b7280; }

.pd-ad-player {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #000;
}

.pd-ad-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.pd-ad-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Link Preview Card (for non-embeddable ads) */
.pd-ad-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 20px;
}

.pd-ad-icon {
    font-size: 40px;
    flex-shrink: 0;
}

.pd-ad-info {
    flex: 1;
    min-width: 0;
}

.pd-ad-platform-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.pd-ad-url-text {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pd-view-btn {
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .pd-links-grid {
        grid-template-columns: 1fr;
    }
    .pd-ads-grid {
        grid-template-columns: 1fr;
    }
    .pd-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .pd-header-top {
        flex-direction: column;
    }
}

/* ==================== Ads Manager — Full Clone ==================== */
/* overflow-x:hidden clips table width. Sticky works because it's inside .am-tbl-wrap */
.am { background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); overflow-x: hidden; }

/* Top bar */
.am-topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid #dddfe2; background: #f7f8fa; flex-wrap: wrap; gap: 8px; }
.am-topbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.am-topbar-right { display: flex; align-items: center; gap: 8px; }
.am-topbar-title { font-size: 18px; font-weight: 700; color: #1c1e21; }
.am-account-select { font-size: 13px; padding: 6px 12px; border: 1px solid #ced0d4; border-radius: 6px; background: #fff; font-weight: 600; max-width: 260px; cursor: pointer; }
.am-select { font-size: 12px; padding: 5px 8px; border: 1px solid #ced0d4; border-radius: 6px; background: #fff; cursor: pointer; }

/* Spending limit — Facebook style */
.am-spend-box { padding: 4px 0; min-width: 180px; }
.am-spend-val { font-size: 13px; font-weight: 700; color: #1c1e21; white-space: nowrap; }
.am-spend-bar { height: 4px; background: #e5e7eb; border-radius: 4px; margin-top: 3px; overflow: hidden; }
.am-spend-fill { height: 100%; background: #e11d48; border-radius: 4px; }
.am-spend-sub { font-size: 11px; color: #65676b; margin-top: 2px; white-space: nowrap; }

/* Tabs */
.am-tabs { display: flex; gap: 0; border-bottom: 2px solid #e4e6eb; padding: 0 16px; background: #fff; }
.am-tab { padding: 10px 24px; font-size: 14px; font-weight: 600; border: none; background: none; cursor: pointer; color: #65676b; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.15s; }
.am-tab:hover { color: #1877f2; background: #f0f7ff; }
.am-tab.active { color: #1877f2; border-bottom-color: #1877f2; }

/* Toolbar */
.am-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; border-bottom: 1px solid #e4e6eb; background: #fff; flex-wrap: wrap; gap: 8px; }
.am-toolbar-left { display: flex; align-items: center; gap: 8px; }
.am-toolbar-right { display: flex; align-items: center; gap: 8px; }
.am-actions { display: flex; align-items: center; gap: 6px; }
.am-sel-count { font-size: 12px; font-weight: 700; color: #1877f2; }
.am-act-btn { padding: 5px 10px; font-size: 12px; border: 1px solid #ced0d4; border-radius: 6px; background: #fff; cursor: pointer; }
.am-act-btn:hover { background: #f0f2f5; border-color: #1877f2; }
.am-act-danger:hover { background: #fef2f2; border-color: #dc2626; color: #dc2626; }
.am-bc { font-size: 12px; color: #65676b; }
.am-bc-link { color: #1877f2; cursor: pointer; }
.am-bc-link:hover { text-decoration: underline; }
.am-search { padding: 6px 10px; font-size: 12px; border: 1px solid #ced0d4; border-radius: 6px; background: #f0f2f5; width: 200px; }
.am-search:focus { outline: none; border-color: #1877f2; background: #fff; box-shadow: 0 0 0 2px rgba(24,119,242,0.15); }
.am-results-bar { padding: 6px 16px; font-size: 12px; color: #65676b; background: #f7f8fa; border-bottom: 1px solid #e4e6eb; }

/* ===== TABLE WRAPPER — this is the scroll container ===== */
.am-tbl-wrap {
    overflow: auto;
    max-height: 60vh;
}

.am-tbl {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
}

/* ===== HEADER  ===== */
.am-tbl thead { position: sticky; top: 0; z-index: 10; }
.am-tbl th {
    padding: 8px 12px; font-size: 11px; font-weight: 600; color: #65676b;
    text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap;
    user-select: none; background: #f7f8fa !important; border-bottom: 2px solid #dddfe2;
    border-right: 1px solid #eceef1; position: relative; text-align: left; cursor: pointer;
}
.am-tbl th:hover { color: #1877f2; background: #eef3f9 !important; }

/* ===== RESIZE HANDLE — visible blue bar ===== */
.am-rz {
    position: absolute; top: 0; right: -2px; width: 5px; height: 100%;
    cursor: col-resize; z-index: 20; background: transparent;
}
.am-rz:hover, .am-rz:active { background: #1877f2; }

/* ===== FROZEN COLUMNS ===== */
.am-fz { position: sticky !important; z-index: 4; }
.am-fz-ck { left: 0; width: 38px; min-width: 38px; text-align: center; }
.am-fz-sw { left: 38px; width: 56px; min-width: 56px; text-align: center; }
.am-fz-tb { left: 94px; width: 44px; min-width: 44px; }
.am-fz-nm { left: 94px; width: 380px; min-width: 300px; border-right: 2px solid #dddfe2 !important; }
/* When thumbnail exists, push name right */
tr:has(.am-fz-tb) .am-fz-nm { left: 138px; width: 340px; min-width: 260px; }

/* Frozen header must be ABOVE everything */
thead .am-fz { z-index: 15 !important; background: #f7f8fa !important; }
/* Frozen body cells — opaque white */
tbody .am-fz { background: #fff !important; }
.am-r:hover .am-fz { background: #f0f7ff !important; }
.am-r-off .am-fz { background: #fafafa !important; }
/* Frozen tfoot */
tfoot .am-fz { z-index: 8 !important; background: #f7f8fa !important; }

/* ===== DATA CELLS ===== */
.am-sc { min-width: 100px; text-align: right; }
.am-sc-plus { width: 32px; min-width: 32px; max-width: 32px; text-align: center; cursor: pointer; font-size: 18px; font-weight: 700; color: #1877f2; background: #f0f7ff !important; }
.am-sc-plus:hover { background: #dbeafe !important; }
.am-sc-plus-d { width: 32px; min-width: 32px; max-width: 32px; }

.am-tbl td {
    padding: 10px 12px; border-bottom: 1px solid #f0f2f5; border-right: 1px solid #f7f8fa;
    vertical-align: middle; color: #1c1e21; font-size: 13px; background: #fff;
    white-space: nowrap;
}

/* Row */
.am-r:hover td { background: #f0f7ff; }
.am-r-off td { opacity: 0.5; }
.am-r-off:hover td { opacity: 1; }

/* ===== STICKY FOOTER ===== */
.am-tbl tfoot { position: sticky; bottom: 0; z-index: 6; }
.am-tr-t td { background: #f7f8fa !important; border-top: 2px solid #dddfe2; border-bottom: none; font-weight: 600; font-size: 12px; }
.am-t-label { font-weight: 700; color: #1c1e21; text-align: left !important; }

/* Sort */
.am-si { font-size: 10px; color: #bec3c9; margin-left: 2px; }
.am-si-on { color: #1877f2; font-weight: 700; }

/* Toggle */
.am-sw { position: relative; display: inline-block; width: 32px; height: 18px; cursor: pointer; }
.am-sw input { opacity: 0; width: 0; height: 0; }
.am-sw-s { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: #ced0d4; border-radius: 18px; transition: 0.2s; }
.am-sw-s:before { content: ''; position: absolute; height: 14px; width: 14px; left: 2px; bottom: 2px; background: #fff; border-radius: 50%; transition: 0.2s; }
.am-sw input:checked + .am-sw-s { background: #1877f2; }
.am-sw input:checked + .am-sw-s:before { transform: translateX(14px); }

/* Name */
.am-nm { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-fz-nm:hover .am-nm { color: #1877f2; }
.am-nm-s { font-size: 11px; color: #65676b; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }

/* ROAS color */
.am-rg { color: #15803d; font-weight: 700; }

/* Delivery */
.am-del { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.am-dot-g { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; display: inline-block; }
.am-dot-y { width: 7px; height: 7px; border-radius: 50%; background: #ced0d4; display: inline-block; }
.am-del-on { color: #15803d; font-weight: 500; }
.am-del-p { color: #65676b; }

/* Budget */
.am-bv { cursor: pointer; padding: 2px 4px; border-radius: 4px; font-size: 12px; }
.am-bv:hover { background: #e4e6eb; }
.am-bi { width: 80px; padding: 3px 6px; font-size: 12px; border: 2px solid #1877f2; border-radius: 4px; outline: none; }

/* Checkbox */
.am-fz-ck input[type="checkbox"], .am-rc { width: 15px; height: 15px; accent-color: #1877f2; cursor: pointer; }

/* Thumbnail */
.am-thumb { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; border: 1px solid #e4e6eb; }
.am-thumb-ph { width: 34px; height: 34px; border-radius: 6px; background: #f0f2f5; display: flex; align-items: center; justify-content: center; font-size: 14px; }

/* Empty */
.am-empty { text-align: center; padding: 40px; color: #65676b; font-size: 14px; }

/* Column picker */
.am-cp-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); z-index: 999; }
.am-cp { position: fixed; top: 0; right: 0; bottom: 0; width: 320px; background: #fff; z-index: 1000; display: flex; flex-direction: column; box-shadow: -4px 0 16px rgba(0,0,0,0.15); }
.am-cp-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #e4e6eb; }
.am-cp-head h4 { margin: 0; font-size: 16px; font-weight: 700; }
.am-cp-close { border: none; background: none; font-size: 20px; cursor: pointer; color: #65676b; }
.am-cp-close:hover { background: #f0f2f5; border-radius: 6px; }
.am-cp-hint { padding: 8px 20px; margin: 0; font-size: 12px; color: #65676b; background: #f7f8fa; border-bottom: 1px solid #e4e6eb; }
.am-cp-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.am-cp-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: 14px; cursor: grab; border-bottom: 1px solid #f0f2f5; }
.am-cp-item:hover { background: #f7f8fa; }
.am-cp-drag { color: #bec3c9; font-size: 16px; cursor: grab; }
.am-cp-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: #1877f2; cursor: pointer; }
.am-cp-label { flex: 1; }
.am-cp-dragging { opacity: 0.4; background: #dbeafe; }
.am-cp-over { border-top: 2px solid #1877f2; }
.am-cp-foot { padding: 12px 20px; border-top: 1px solid #e4e6eb; }
.am-cp-apply { width: 100%; padding: 10px; font-size: 14px; font-weight: 600; background: #1877f2; color: #fff; border: none; border-radius: 6px; cursor: pointer; }
.am-cp-apply:hover { background: #166fe5; }

@media (max-width: 768px) {
    .am-toolbar { flex-direction: column; }
    .am-search { width: 100%; }
    .am-fz-nm { width: 200px; min-width: 180px; }
}

/* ==================== Store Management — Multi-Token Cards ==================== */
.mt-token-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mt-empty-tokens {
    text-align: center;
    padding: 30px 20px;
    background: #f7f8fa;
    border: 2px dashed #e4e6eb;
    border-radius: 12px;
    color: #65676b;
}

.mt-empty-tokens p:first-child { font-size: 14px; font-weight: 600; margin-bottom: 4px; }

.mt-token-card {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.15s;
}

.mt-token-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

.mt-token-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.mt-token-left { display: flex; flex-direction: column; gap: 2px; }

.mt-token-label { font-size: 15px; font-weight: 700; color: #1c1e21; }
.mt-token-user { font-size: 12px; color: #65676b; }

.mt-token-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mt-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.mt-delete-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.15s;
    opacity: 0.5;
}

.mt-delete-btn:hover { opacity: 1; background: #fee2e2; }

.mt-token-meta { margin-bottom: 12px; }

.mt-token-masked {
    display: inline-block;
    background: #f7f8fa;
    border: 1px solid #e4e6eb;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    color: #65676b;
}

.mt-accounts-section {
    background: #f7f8fa;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    padding: 12px 14px;
}

.mt-accounts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #1c1e21;
    margin-bottom: 10px;
}

.mt-refresh-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}

.mt-refresh-btn:hover { background: #e4e6eb; }

.mt-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 300px;
    overflow-y: auto;
}

.mt-account-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.mt-account-row:hover { border-color: #1877f2; background: #f0f7ff; }

.mt-account-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1877f2;
    cursor: pointer;
    flex-shrink: 0;
}

.mt-account-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.mt-account-name {
    font-size: 13px;
    font-weight: 600;
    color: #1c1e21;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mt-account-meta {
    font-size: 11px;
    color: #65676b;
    font-family: 'SFMono-Regular', Consolas, monospace;
}

.sm-fb-tip {
    padding: 12px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 12px;
    color: #1e40af;
    line-height: 1.6;
}

.sm-fb-tip a { color: #1877f2; font-weight: 600; text-decoration: none; }
.sm-fb-tip a:hover { text-decoration: underline; }

.sm-fb-modal-info {
    background: #f7f8fa;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 13px;
}

.sm-fb-modal-info p { margin: 0 0 4px; font-size: 13px; }

.sm-fb-modal-info code {
    background: #e4e6eb;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

@media (max-width: 640px) {
    .mt-token-header { flex-direction: column; }
    .mt-token-right { align-self: flex-end; }
}


}

/* ==================== Attendance Dashboard ==================== */
.badge-late { background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }

.attendance-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.att-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.att-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.att-summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.att-summary-card.green::before { background: #10b981; }
.att-summary-card.orange::before { background: #f97316; }
.att-summary-card.red::before { background: #ef4444; }
.att-summary-card.yellow::before { background: #eab308; }
.att-summary-card.blue::before { background: #3b82f6; }
.att-summary-card.purple::before { background: #a855f7; }

.att-summary-card .att-value {
    font-size: 32px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 4px;
}

.att-summary-card .att-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Attendance Filter Toolbar */
.att-filter-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
    flex-wrap: wrap;
}

.att-filter-toolbar input[type="date"] {
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    outline: none;
}

.att-filter-toolbar input[type="date"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.att-filter-toolbar label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* OTP Approval Cards */
.otp-requests-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.otp-request-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.otp-request-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
}

.otp-request-card.login::before { background: #3b82f6; }
.otp-request-card.early_checkout::before { background: #f59e0b; }

.otp-request-card:hover {
    box-shadow: var(--shadow-md);
}

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

.otp-card-user {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.otp-card-reason {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.otp-card-reason.login { background: #dbeafe; color: #1d4ed8; }
.otp-card-reason.early_checkout { background: #fef3c7; color: #b45309; }

.otp-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.otp-card-timer {
    font-weight: 600;
    color: #ef4444;
}

.otp-card-actions {
    display: flex;
    gap: 8px;
}

/* Blocking Checkout Modal */
.checkout-blocking-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.checkout-blocking-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Notification Badge */
.nav-item .notification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    margin-left: auto;
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Auto checkout indicator */
.auto-checkout-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
}

/* Attendance timer */
.att-work-timer {
    font-size: 15px;
    color: var(--status-must-try);
    font-weight: 700;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.att-work-timer .timer-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: timerBlink 1s infinite;
}

@keyframes timerBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ==================== Inbox — Meta Business Suite Style ==================== */
.ibx { background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); display: flex; flex-direction: column; height: calc(100vh - 140px); overflow: hidden; }

/* Header */
.ibx-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #e4e6eb; }
.ibx-header-left { display: flex; flex-direction: column; }
.ibx-title { font-size: 22px; font-weight: 700; color: #1c1e21; margin: 0; }
.ibx-subtitle { font-size: 13px; color: #65676b; margin-top: 2px; }
.ibx-page-select { font-size: 13px; padding: 6px 12px; border: 1px solid #ced0d4; border-radius: 6px; background: #fff; font-weight: 600; cursor: pointer; }

/* Tabs */
.ibx-tabs { display: flex; gap: 0; border-bottom: 2px solid #e4e6eb; padding: 0 16px; background: #f7f8fa; }
.ibx-tab { padding: 10px 20px; font-size: 13px; font-weight: 600; border: none; background: none; cursor: pointer; color: #65676b; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.15s; white-space: nowrap; }
.ibx-tab:hover { color: #1877f2; background: #f0f2f5; }
.ibx-tab.active { color: #1877f2; border-bottom-color: #1877f2; }

/* Body — 2 panel layout */
.ibx-body { display: flex; flex: 1; overflow: hidden; }

/* Left panel */
.ibx-left { width: 360px; min-width: 300px; max-width: 400px; border-right: 1px solid #e4e6eb; display: flex; flex-direction: column; background: #fff; }
.ibx-search { padding: 10px 12px; border-bottom: 1px solid #e4e6eb; }
.ibx-search-input { width: 100%; padding: 8px 12px; border: 1px solid #ced0d4; border-radius: 20px; font-size: 13px; background: #f0f2f5; outline: none; box-sizing: border-box; }
.ibx-search-input:focus { border-color: #1877f2; background: #fff; }
.ibx-list { flex: 1; overflow-y: auto; }
.ibx-list-empty { padding: 40px 20px; text-align: center; color: #65676b; }

/* List items */
.ibx-item { display: flex; padding: 12px 14px; gap: 10px; cursor: pointer; border-bottom: 1px solid #f0f2f5; transition: background 0.1s; }
.ibx-item:hover { background: #f0f2f5; }
.ibx-item-active { background: #e7f3ff !important; border-left: 3px solid #1877f2; }
.ibx-item-avatar { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: #e4e6eb; }
.ibx-item-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ibx-item-avatar-sq { border-radius: 8px; }
.ibx-item-body { flex: 1; min-width: 0; }
.ibx-item-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ibx-item-name { font-size: 13px; font-weight: 600; color: #1c1e21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.ibx-item-time { font-size: 11px; color: #65676b; white-space: nowrap; }
.ibx-item-preview { font-size: 12px; color: #65676b; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ibx-item-meta { font-size: 11px; color: #8a8d91; margin-top: 3px; }
.ibx-unread { background: #1877f2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; margin-left: 4px; }
.ibx-avatar-circle { width: 44px; height: 44px; border-radius: 50%; background: #1877f2; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.ibx-avatar-circle-sm { width: 32px; height: 32px; border-radius: 50%; background: #1877f2; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }

/* Center panel */
.ibx-center { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #f7f8fa; }
.ibx-empty-thread { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; color: #65676b; text-align: center; padding: 40px; }
.ibx-empty-thread h3 { margin: 0 0 8px; color: #1c1e21; }
.ibx-empty-thread p { margin: 0; font-size: 14px; }

/* Thread */
.ibx-thread { display: flex; flex-direction: column; height: 100%; }
.ibx-thread-header { padding: 12px 16px; background: #fff; border-bottom: 1px solid #e4e6eb; flex-shrink: 0; }
.ibx-thread-post { }
.ibx-thread-img { max-width: 100%; max-height: 200px; border-radius: 8px; margin-bottom: 8px; object-fit: cover; }
.ibx-thread-post-text { font-size: 14px; color: #1c1e21; line-height: 1.4; }
.ibx-thread-post-meta { font-size: 12px; color: #65676b; margin-top: 6px; }

/* Comments */
.ibx-comments { flex: 1; overflow-y: auto; padding: 12px 16px; }
.ibx-comment { display: flex; gap: 8px; margin-bottom: 14px; }
.ibx-comment-reply { margin-left: 24px; }
.ibx-comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #e4e6eb; }
.ibx-comment-avatar-sm { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #e4e6eb; }
.ibx-comment-avatar-ph { width: 36px; height: 36px; border-radius: 50%; background: #1877f2; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.ibx-comment-avatar-ph-sm { width: 28px; height: 28px; border-radius: 50%; background: #65676b; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.ibx-comment-body { flex: 1; min-width: 0; }
.ibx-comment-name { font-size: 13px; font-weight: 600; color: #1c1e21; }
.ibx-comment-text { font-size: 13px; color: #1c1e21; background: #f0f2f5; padding: 8px 12px; border-radius: 12px; margin-top: 2px; line-height: 1.4; display: inline-block; word-break: break-word; }
.ibx-comment-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; font-size: 12px; color: #65676b; }
.ibx-comment-time { font-size: 11px; color: #8a8d91; }
.ibx-act-btn { background: none; border: none; font-size: 12px; font-weight: 600; color: #65676b; cursor: pointer; padding: 0; }
.ibx-act-btn:hover { color: #1877f2; text-decoration: underline; }
.ibx-replies { margin-top: 6px; }

/* Reply inline */
.ibx-reply-inline { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.ibx-reply-input-sm { flex: 1; padding: 6px 10px; border: 1px solid #ced0d4; border-radius: 18px; font-size: 12px; outline: none; }
.ibx-reply-btn-sm { background: #1877f2; color: #fff; border: none; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; }

/* Reply box (bottom) */
.ibx-reply-box { display: flex; gap: 8px; padding: 10px 16px; background: #fff; border-top: 1px solid #e4e6eb; flex-shrink: 0; }
.ibx-reply-input { flex: 1; padding: 10px 14px; border: 1px solid #ced0d4; border-radius: 20px; font-size: 13px; outline: none; background: #f0f2f5; }
.ibx-reply-input:focus { border-color: #1877f2; background: #fff; }
.ibx-reply-btn { background: #1877f2; color: #fff; border: none; padding: 8px 20px; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; }
.ibx-reply-btn:hover { background: #166fe5; }

/* Messenger */
.ibx-msg-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #fff; border-bottom: 1px solid #e4e6eb; flex-shrink: 0; }
.ibx-msg-name { font-size: 16px; font-weight: 700; color: #1c1e21; }
.ibx-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.ibx-msg { display: flex; }
.ibx-msg-in { justify-content: flex-start; }
.ibx-msg-out { justify-content: flex-end; }
.ibx-msg-bubble { max-width: 65%; padding: 8px 14px; border-radius: 18px; word-break: break-word; }
.ibx-msg-bubble-in { background: #f0f2f5; color: #1c1e21; border-bottom-left-radius: 4px; }
.ibx-msg-bubble-out { background: #1877f2; color: #fff; border-bottom-right-radius: 4px; }
.ibx-msg-text { font-size: 14px; line-height: 1.4; }
.ibx-msg-time { font-size: 10px; opacity: 0.7; margin-top: 3px; }
.ibx-msg-attachment { max-width: 200px; border-radius: 8px; margin-top: 4px; }

/* ==================== Performance Dashboard ==================== */
.perf-pill {
    padding: 7px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #fff;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: 'Inter', sans-serif;
}

.perf-pill:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.perf-pill.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.perf-select {
    padding: 7px 32px 7px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    outline: none;
    transition: border-color 0.15s ease;
}

.perf-select:focus {
    border-color: #2563eb;
}

/* ==================== Daily Motivation Banner ==================== */
.moti-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 24px;
    background: linear-gradient(135deg, #fef9c3 0%, #fde68a 50%, #fcd34d 100%);
    border-bottom: 1px solid #f59e0b22;
    animation: motiFadeIn 0.6s ease;
}

.moti-icon {
    font-size: 16px;
    flex-shrink: 0;
    animation: motiPulse 2s ease-in-out infinite;
}

.moti-text {
    font-size: 13px;
    font-weight: 500;
    color: #78350f;
    letter-spacing: 0.3px;
    font-family: 'Inter', sans-serif;
    text-align: center;
    line-height: 1.4;
}

@keyframes motiFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes motiPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ==================== Product Tags ==================== */
.product-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    margin-bottom: 2px;
}

.tag-costly {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.tag-already_runned {
    background: #f5f3ff;
    color: #8b5cf6;
    border: 1px solid #ede9fe;
}

/* New rejection reason tags */
.tag-high_price {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.tag-bad_creative {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.tag-low_demand {
    background: #ede9fe;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}

.tag-not_scalable {
    background: #e0e7ff;
    color: #4f46e5;
    border: 1px solid #c7d2fe;
}

/* ==================== Resent Status ==================== */
.badge-resent {
    background: #fef3c7 !important;
    color: #92400e !important;
    border: 1px solid #fde68a;
}

.nstatus-resent {
    background: #fef3c7;
    color: #92400e;
}

/* Resend count badge */
.resend-count-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    margin-left: 4px;
}

.resend-count-badge.warning {
    background: #fee2e2;
    color: #b91c1c;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Resend remark display box */
.resend-remark-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Rechecked badge */
.badge-rechecked {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    background: #d1fae5;
    color: #065f46;
    margin-left: 4px;
}

/* Resend reason type badges */
.resend-reason-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    margin-top: 2px;
}

/* Resend history list */
.resend-history-list {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    margin-top: 8px;
}

.resend-history-item {
    padding: 6px 0;
    border-bottom: 1px solid #fde68a;
    color: #92400e;
    line-height: 1.4;
}
.resend-history-item:last-child { border-bottom: none; }

