* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: #f9fafb;
    color: #1f2937;
    line-height: 1.5;
}

main {
    padding: 24px 32px;
    max-width: 1600px;
    margin: 0 auto;
}

section {
    margin-bottom: 28px;
}

section > h2 {
    font-size: 13px;
    margin-bottom: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   WORKER GORSEL KARTLAR
   ============================================================ */

.worker-visual-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e5e7eb;
}

.worker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 200px));
    gap: 24px;
    justify-content: start;
}

.worker-loading {
    color: #9ca3af;
    padding: 20px;
    grid-column: 1 / -1;
    text-align: center;
}

.worker-card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.worker-total {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2px;
}

body.dark .worker-total {
    color: #94a3b8;
}

.worker-card {
    position: relative;
    width: 200px;
    height: 200px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.worker-card:hover {
    transform: scale(1.04);
}

.worker-card svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* DURUM RENKLERI */
.worker-card[data-status="active"] .worker-bg-circle {
    fill: white;
    stroke: #10b981;
    stroke-width: 2;
    filter: drop-shadow(0 0 16px rgba(16, 185, 129, 0.5));
    animation: pulse-active 2.5s ease-in-out infinite;
}

.worker-card[data-status="active"] .worker-ring-bg {
    stroke: #d1fae5;
}

.worker-card[data-status="active"] .worker-ring-progress {
    stroke: #10b981;
}

.worker-card[data-status="active"] .worker-text-id,
.worker-card[data-status="active"] .worker-text-count,
.worker-card[data-status="active"] .worker-text-label,
.worker-card[data-status="active"] .worker-text-heartbeat {
    fill: #1f2937;
}

@keyframes pulse-active {
    0%, 100% {
        filter: drop-shadow(0 0 16px rgba(16, 185, 129, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 24px rgba(16, 185, 129, 0.8));
    }
}

.worker-card[data-status="cooldown"] .worker-bg-circle {
    fill: white;
    stroke: #f59e0b;
    stroke-width: 2;
    filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.4));
}

.worker-card[data-status="cooldown"] .worker-ring-bg {
    stroke: #fef3c7;
}

.worker-card[data-status="cooldown"] .worker-ring-progress {
    stroke: #f59e0b;
}

.worker-card[data-status="cooldown"] .worker-text-id,
.worker-card[data-status="cooldown"] .worker-text-count,
.worker-card[data-status="cooldown"] .worker-text-label,
.worker-card[data-status="cooldown"] .worker-text-heartbeat {
    fill: #1f2937;
}

.worker-card[data-status="cooldown"] .worker-text-count {
    animation: blink-warn 1.5s ease infinite;
}

@keyframes blink-warn {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

.worker-card[data-status="offline"] .worker-bg-circle {
    fill: white;
    stroke: #d1d5db;
    stroke-width: 1.5;
    opacity: 0.7;
}

.worker-card[data-status="offline"] .worker-ring-bg {
    stroke: #f3f4f6;
}

.worker-card[data-status="offline"] .worker-ring-progress {
    stroke: #d1d5db;
}

.worker-card[data-status="offline"] .worker-text-id,
.worker-card[data-status="offline"] .worker-text-count,
.worker-card[data-status="offline"] .worker-text-label,
.worker-card[data-status="offline"] .worker-text-heartbeat {
    fill: #9ca3af;
}

.worker-card[data-status="sleeping"] .worker-bg-circle {
    fill: white;
    stroke: #a78bfa;
    stroke-width: 2;
    filter: drop-shadow(0 0 10px rgba(167, 139, 250, 0.4));
}

.worker-card[data-status="sleeping"] .worker-ring-bg {
    stroke: #ede9fe;
}

.worker-card[data-status="sleeping"] .worker-ring-progress {
    stroke: #a78bfa;
}

.worker-card[data-status="sleeping"] .worker-text-id,
.worker-card[data-status="sleeping"] .worker-text-count,
.worker-card[data-status="sleeping"] .worker-text-label,
.worker-card[data-status="sleeping"] .worker-text-heartbeat {
    fill: #1f2937;
}


/* RING */
.worker-bg-circle {
    transition: all 0.3s ease;
}

.worker-ring-bg {
    fill: none;
    stroke-width: 4;
}

.worker-ring-progress {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 0.5s ease;
}

/* METINLER */
.worker-text-id {
    font-size: 13px;
    font-weight: 600;
    text-anchor: middle;
    letter-spacing: 0.3px;
}

.worker-text-count {
    font-size: 38px;
    font-weight: 700;
    text-anchor: middle;
    transition: transform 0.5s;
}

.worker-text-label {
    font-size: 10px;
    text-anchor: middle;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
    opacity: 0.85;
}

.worker-text-heartbeat {
    font-size: 9.5px;
    text-anchor: middle;
    opacity: 0.7;
}

/* FLASH (yeni tarama) */
.worker-card.flash .worker-bg-circle {
    animation: flash-bright 0.5s ease;
}

@keyframes flash-bright {
    0%, 100% { stroke-width: 2; }
    50%       { stroke-width: 4; }
}

/* ROZETLER */
.worker-badge-failover {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: #f97316;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.worker-badge-captcha {
    position: absolute;
    top: 8px;
    right: 14px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    min-width: 24px;
    text-align: center;
}

/* ============================================================
   OZET KARTLARI (PASTEL + SPARKLINE)
   ============================================================ */

.stats-section {
    margin-top: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.stat-card {
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid;
    position: relative;
    overflow: hidden;
}

.stat-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b7280;
    margin-bottom: 8px;
}

.stat-finance-msg {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 4px;
    min-height: 14px;
}

.stat-finance-warn {
    color: #f59e0b;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.stat-spark {
    width: 70px;
    height: 24px;
    flex-shrink: 0;
}

.spark-line {
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* PASTEL ARKA PLANLAR */
.stat-card-blue   { background: #eff6ff; border-color: #dbeafe; }
.stat-card-orange { background: #fff7ed; border-color: #fed7aa; }
.stat-card-cyan   { background: #ecfeff; border-color: #cffafe; }
.stat-card-yellow { background: #fefce8; border-color: #fef08a; }
.stat-card-green  { background: #f0fdf4; border-color: #bbf7d0; }
.stat-card-red    { background: #fef2f2; border-color: #fecaca; }
.stat-card-purple { background: #faf5ff; border-color: #e9d5ff; }
.stat-card-indigo { background: #eef2ff; border-color: #c7d2fe; }

/* SPARKLINE RENKLERI */
.spark-blue   { stroke: #3b82f6; }
.spark-orange { stroke: #f97316; }
.spark-cyan   { stroke: #06b6d4; }
.spark-yellow { stroke: #eab308; }
.spark-green  { stroke: #22c55e; }
.spark-red    { stroke: #ef4444; }
.spark-purple { stroke: #a855f7; }
.spark-indigo { stroke: #6366f1; }

/* ============================================================
   ADMIN BUTONLARI
   ============================================================ */

.admin-buttons {
    background: white;
    padding: 16px 20px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.admin-buttons h2 {
    margin-bottom: 12px;
}

.admin-buttons button {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 8px 16px;
    border-radius: 20px;
    margin-right: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}

.admin-buttons button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.admin-buttons button:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

#admin-result {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: "Consolas", monospace;
    white-space: pre-wrap;
    background: #f9fafb;
    color: #374151;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    border: 1px solid #e5e7eb;
}

#admin-result.show  { display: block; }

#admin-result.error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

#admin-result.success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

/* ============================================================
   TABLOLAR
   ============================================================ */

table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    font-size: 13px;
    border: 1px solid #e5e7eb;
}

th {
    background: #f9fafb;
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.6px;
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #374151;
}

tr:hover { background: #f9fafb; }

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

td a {
    color: #3b82f6;
    text-decoration: none;
    margin-right: 8px;
}

td a:hover { text-decoration: underline; }

/* WORKER STATUS BADGES (tablo icinde) */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-active   { background: #d1fae5; color: #065f46; }
.badge-cooldown { background: #fef3c7; color: #92400e; }
.badge-offline  { background: #f3f4f6; color: #6b7280; }
.badge-sleeping { background: #ede9fe; color: #5b21b6; }

/* LOG SEVIYESI */
.log-info  { color: #374151; }
.log-warn  { color: #c2410c; }
.log-error { color: #b91c1c; font-weight: 600; }

/* SCAN BASARI/HATA */
.scan-success {
    color: #16a34a;
    font-weight: 500;
}

.scan-fail {
    color: #dc2626;
    font-weight: 500;
}

.scan-fail::after {
    content: " !";
    font-size: 14px;
}

/* MOBILE */
@media (max-width: 768px) {
    main   { padding: 16px; }
    .worker-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 160px));
        gap: 16px;
    }
    .worker-card {
        width: 160px;
        height: 160px;
    }
    .worker-text-count { font-size: 28px; }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .stat-value { font-size: 22px; }
}

/* ============================================================
   RENK DUZELTMELERI (LIGHT MODE)
   Worker kart yazilari koyu renk (offline disinda)
   ============================================================ */

.worker-card .worker-text-id,
.worker-card .worker-text-count,
.worker-card .worker-text-label,
.worker-card .worker-text-heartbeat {
    fill: #1f2937 !important;
}

.worker-card[data-status="offline"] .worker-text-id,
.worker-card[data-status="offline"] .worker-text-count,
.worker-card[data-status="offline"] .worker-text-label,
.worker-card[data-status="offline"] .worker-text-heartbeat {
    fill: #6b7280 !important;
}

/* ============================================================
   DARK MODE
   ============================================================ */

body.dark {
    background: #0f172a;
    color: #e2e8f0;
}

body.dark section > h2 {
    color: #94a3b8;
}

body.dark .worker-visual-section {
    background: #1e293b;
    border-color: #334155;
}

body.dark .worker-card .worker-text-id,
body.dark .worker-card .worker-text-count,
body.dark .worker-card .worker-text-label,
body.dark .worker-card .worker-text-heartbeat {
    fill: #e2e8f0 !important;
}

body.dark .worker-card[data-status="offline"] .worker-text-id,
body.dark .worker-card[data-status="offline"] .worker-text-count,
body.dark .worker-card[data-status="offline"] .worker-text-label,
body.dark .worker-card[data-status="offline"] .worker-text-heartbeat {
    fill: #64748b !important;
}

body.dark .worker-card[data-status="active"] .worker-bg-circle,
body.dark .worker-card[data-status="cooldown"] .worker-bg-circle,
body.dark .worker-card[data-status="sleeping"] .worker-bg-circle {
    fill: #1e293b;
}

body.dark .worker-card[data-status="offline"] .worker-bg-circle {
    fill: #1e293b;
    stroke: #475569;
}

body.dark .stat-card-blue   { background: #1e293b; border-color: #1e3a8a; }
body.dark .stat-card-orange { background: #1e293b; border-color: #7c2d12; }
body.dark .stat-card-cyan   { background: #1e293b; border-color: #155e75; }
body.dark .stat-card-yellow { background: #1e293b; border-color: #713f12; }
body.dark .stat-card-green  { background: #1e293b; border-color: #14532d; }
body.dark .stat-card-red    { background: #1e293b; border-color: #7f1d1d; }
body.dark .stat-card-purple { background: #1e293b; border-color: #581c87; }
body.dark .stat-card-indigo { background: #1e293b; border-color: #312e81; }

body.dark .stat-label { color: #94a3b8; }
body.dark .stat-value { color: #f1f5f9; }

body.dark .admin-buttons {
    background: #1e293b;
    border-color: #334155;
}

body.dark .admin-buttons button {
    background: #0f172a;
    color: #cbd5e1;
    border-color: #475569;
}

body.dark .admin-buttons button:hover {
    background: #1e293b;
    border-color: #64748b;
}

body.dark #admin-result {
    background: #0f172a;
    color: #cbd5e1;
    border-color: #334155;
}

body.dark #admin-result.error {
    background: #450a0a;
    color: #fecaca;
    border-color: #7f1d1d;
}

body.dark #admin-result.success {
    background: #052e16;
    color: #bbf7d0;
    border-color: #14532d;
}

body.dark table {
    background: #1e293b;
    border-color: #334155;
}

body.dark th {
    background: #0f172a;
    color: #94a3b8;
    border-bottom-color: #334155;
}

body.dark td {
    color: #cbd5e1;
    border-bottom-color: #334155;
}

body.dark tr:hover { background: #0f172a; }

body.dark td a { color: #60a5fa; }

body.dark .badge-active   { background: #064e3b; color: #6ee7b7; }
body.dark .badge-cooldown { background: #78350f; color: #fcd34d; }
body.dark .badge-offline  { background: #1e293b; color: #94a3b8; }
body.dark .badge-sleeping { background: #4c1d95; color: #c4b5fd; }

body.dark .log-info  { color: #cbd5e1; }
body.dark .log-warn  { color: #fbbf24; }
body.dark .log-error { color: #f87171; }

body.dark .scan-success { color: #4ade80; }
body.dark .scan-fail    { color: #f87171; }

/* ============================================================
   EBAY STOK RENK SINIFLARI
   ============================================================ */
.qty-zero {
    color: #dc2626;
    font-weight: 700;
    background: #fef2f2;
    padding: 2px 8px;
    border-radius: 4px;
}

.qty-active {
    color: #16a34a;
    font-weight: 600;
}

body.dark .qty-zero {
    background: #450a0a;
    color: #fecaca;
}

body.dark .qty-active {
    color: #4ade80;
}

/* ============================================================
   GRID ORTALAMA
   ============================================================ */
.worker-grid {
    justify-content: center !important;
}

/* ============================================================
   RING ANIMASYONU (aktif worker'da yavas donus)
   ============================================================ */
.worker-card[data-status="active"] .worker-ring-progress {
    stroke-dasharray: 440 200;
    animation: ring-rotate 4s linear infinite;
    transform-origin: center;
}

@keyframes ring-rotate {
    0%   { transform: rotate(-90deg); }
    100% { transform: rotate(270deg); }
}

.worker-card[data-status="cooldown"] .worker-ring-progress {
    stroke-dasharray: 440 200;
    animation: ring-rotate 6s linear infinite;
    transform-origin: center;
}

.worker-card[data-status="offline"] .worker-ring-progress,
.worker-card[data-status="sleeping"] .worker-ring-progress {
    animation: none;
    stroke-dashoffset: 0;
    transform: rotate(-90deg);
}

/* ============================================================
   MASTER KART (mavi, ortada)
   ============================================================ */
.worker-card[data-status="master"] .worker-bg-circle {
    fill: white;
    stroke: #3b82f6;
    stroke-width: 2;
    filter: drop-shadow(0 0 16px rgba(59, 130, 246, 0.5));
    animation: pulse-master 3s ease-in-out infinite;
}

.worker-card[data-status="master"] .worker-ring-bg {
    stroke: #dbeafe;
}

.worker-card[data-status="master"] .worker-ring-progress {
    stroke: #3b82f6;
    stroke-dasharray: 440 200;
    animation: ring-rotate 5s linear infinite;
    transform-origin: center;
}

.worker-card[data-status="master"] .worker-text-id,
.worker-card[data-status="master"] .worker-text-count,
.worker-card[data-status="master"] .worker-text-label,
.worker-card[data-status="master"] .worker-text-heartbeat {
    fill: #1e40af;
}

@keyframes pulse-master {
    0%, 100% { filter: drop-shadow(0 0 16px rgba(59, 130, 246, 0.5)); }
    50%       { filter: drop-shadow(0 0 24px rgba(59, 130, 246, 0.8)); }
}

.worker-badge-master {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: #3b82f6;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

body.dark .worker-card[data-status="master"] .worker-bg-circle {
    fill: #1e293b;
}

body.dark .worker-card[data-status="master"] .worker-text-id,
body.dark .worker-card[data-status="master"] .worker-text-count,
body.dark .worker-card[data-status="master"] .worker-text-label,
body.dark .worker-card[data-status="master"] .worker-text-heartbeat {
    fill: #93c5fd;
}

/* ============================================================
   YENI TOPBAR
   ============================================================ */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: #1f2937;
    border-bottom: 1px solid #374151;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 20px;
}

.topbar-left,
.topbar-center,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-center {
    flex: 1;
    justify-content: center;
}

/* LOGO */
.logo-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1.5px solid rgba(34, 211, 238, 0.4);
    background: rgba(34, 211, 238, 0.05);
    transition: all 0.3s;
}

.logo-box:hover {
    border-color: rgba(34, 211, 238, 0.7);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.3);
}

.logo-icon {
    font-size: 20px;
    color: #22d3ee;
}

.logo-text {
    font-size: 16px;
    font-weight: 600;
    color: #e5e7eb;
    letter-spacing: 0.3px;
}

.logo-text-accent {
    color: #22d3ee;
}

/* NAV TABS */
.nav-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 10px;
    border: 1.5px solid rgba(156, 163, 175, 0.25);
    background: rgba(255,255,255,0.02);
    color: #9ca3af;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.nav-tab::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 1.5px;
    background: linear-gradient(120deg, transparent 30%, rgba(34, 211, 238, 0.4), transparent 70%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    background-size: 200% 200%;
    animation: rotate-gradient 4s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.nav-tab:hover {
    color: #e5e7eb;
    border-color: rgba(34, 211, 238, 0.5);
    background: rgba(34, 211, 238, 0.06);
}

.nav-tab:hover::before {
    opacity: 1;
}

.nav-tab.active {
    color: #22d3ee;
    border-color: rgba(34, 211, 238, 0.6);
    background: rgba(34, 211, 238, 0.08);
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.25);
}

.nav-tab.active::before {
    opacity: 1;
}

@keyframes rotate-gradient {
    0%   { background-position: 0% 0%; }
    100% { background-position: 200% 200%; }
}

.nav-tab-icon {
    font-size: 14px;
}

.nav-tab-label {
    font-weight: 500;
}

/* STORE SELECTOR */
.store-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid rgba(251, 146, 60, 0.5);
    background: rgba(251, 146, 60, 0.06);
    position: relative;
    overflow: visible;
    transition: all 0.25s;
}

.store-selector-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 1.5px;
    background: linear-gradient(120deg, transparent 30%, rgba(251, 146, 60, 0.5), transparent 70%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    background-size: 200% 200%;
    animation: rotate-gradient 5s linear infinite;
    opacity: 0.7;
    pointer-events: none;
}

.store-selector-wrapper:hover {
    border-color: rgba(251, 146, 60, 0.8);
    box-shadow: 0 0 14px rgba(251, 146, 60, 0.3);
}

.store-selector-icon {
    font-size: 14px;
}

.store-selector-label {
    font-size: 13px;
    color: #fbbf24;
    font-weight: 500;
}

.store-selector-native-hidden {
    display: none;
}

/* CUSTOM DROPDOWN BUTTON */
.store-selector-btn {
    background: transparent;
    border: none;
    color: #fed7aa;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    padding: 0 4px;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    position: relative;
    z-index: 3;
    min-width: 160px;
    width: 100%;
    text-align: left;
}

.store-selector-btn:hover {
    color: #ffedd5;
}

/* DROPDOWN MENU */
.store-selector-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    min-width: 200px;
    background: #1f2937;
    border: 1.5px solid rgba(251, 146, 60, 0.4);
    border-radius: 10px;
    padding: 6px;
    list-style: none;
    margin: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.store-selector-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.store-selector-menu li {
    padding: 10px 14px;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.store-selector-menu li:hover {
    background: rgba(251, 146, 60, 0.12);
    color: #fed7aa;
}

.store-selector-menu li.active {
    background: rgba(251, 146, 60, 0.2);
    color: #fed7aa;
    font-weight: 600;
}

.store-selector-menu li.active::before {
    content: "●";
    color: #fb923c;
    font-size: 12px;
    text-shadow: 0 0 6px rgba(251, 146, 60, 0.6);
}

.store-selector-menu li:not(.active)::before {
    content: "○";
    color: rgba(156, 163, 175, 0.35);
    font-size: 11px;
}

/* "+ Add Store" item */
.store-selector-menu li.store-add-item {
    color: #22d3ee;
    font-weight: 600;
    gap: 8px;
    cursor: pointer;
    pointer-events: auto;
}
.store-selector-menu li.store-add-item::before { display: none; }
.store-selector-menu li.store-add-item:hover {
    background: rgba(34, 211, 238, 0.1);
    color: #67e8f9;
}

/* DARK MODE */
body.dark .store-selector-menu {
    background: #0f172a;
    border-color: rgba(251, 146, 60, 0.3);
}

body.dark .store-selector-menu li {
    color: #cbd5e1;
}

body.dark .store-selector-menu li:hover {
    background: rgba(251, 146, 60, 0.1);
    color: #fed7aa;
}

.store-selector-native option {
    background: #1f2937;
    color: #fed7aa;
}

.store-selector-arrow {
    color: #fbbf24;
    font-size: 12px;
    pointer-events: none;
}

/* TOPBAR ICON BUTTONS */
.topbar-icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1.5px solid rgba(156, 163, 175, 0.25);
    background: rgba(255,255,255,0.02);
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}

.topbar-icon-btn:hover:not(:disabled) {
    border-color: rgba(156, 163, 175, 0.5);
    color: #e5e7eb;
}

.topbar-icon-btn:disabled {
    cursor: default;
    opacity: 0.6;
}

.topbar-icon {
    font-size: 16px;
}

.topbar-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #1f2937;
}

/* BILDIRIM PANELI */
.notif-wrapper {
    position: relative;
}
.notif-panel {
    display: none;
    position: absolute;
    top: 46px;
    right: 0;
    width: 340px;
    max-height: 460px;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 2000;
    overflow: hidden;
    flex-direction: column;
}
.notif-panel.open {
    display: flex;
}
.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #1e293b;
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
}
.notif-markall {
    background: none;
    border: none;
    color: #22d3ee;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
}
.notif-markall:hover { text-decoration: underline; }
.notif-list {
    overflow-y: auto;
    max-height: 410px;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px 14px;
    border-bottom: 1px solid #161f30;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.notif-item:hover { background: rgba(255,255,255,0.03); }
.notif-item.unread { background: rgba(34,211,238,0.06); }
.notif-item-main {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.notif-del {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #475569;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 5px;
    transition: all 0.15s;
}
.notif-del:hover { color: #ef4444; background: rgba(239,68,68,0.12); }
.notif-panel-footer {
    border-top: 1px solid #1e293b;
    padding: 9px 14px;
    text-align: center;
}
.notif-clearread {
    background: none;
    border: none;
    color: #64748b;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
}
.notif-clearread:hover { color: #94a3b8; text-decoration: underline; }
.notif-item.unread .notif-title::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22d3ee;
    margin-right: 6px;
    vertical-align: middle;
}
.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 3px;
}
.notif-body {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}
.notif-time {
    font-size: 10px;
    color: #475569;
    margin-top: 4px;
}
.notif-empty {
    padding: 28px 14px;
    text-align: center;
    font-size: 12px;
    color: #64748b;
}

/* AVATAR */
@keyframes avatar-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.topbar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(156, 163, 175, 0.3);
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    color: #e5e7eb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.25s;
    position: relative;
    isolation: isolate;
}

.topbar-avatar::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        transparent 270deg,
        rgba(59, 130, 246, 0.8) 320deg,
        transparent 360deg
    );
    animation: avatar-spin 3s linear infinite;
    z-index: -1;
    filter: blur(0.5px);
    will-change: transform;
}

.topbar-avatar.is-admin::before {
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        transparent 270deg,
        rgba(251, 146, 60, 0.8) 320deg,
        transparent 360deg
    );
}

.topbar-avatar:hover:not(:disabled)::before {
    animation-duration: 1.5s;
}

.topbar-avatar:hover:not(:disabled) {
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.2);
}

.topbar-avatar:disabled {
    cursor: default;
    opacity: 0.7;
}

.avatar-letter {
    font-size: 14px;
    font-weight: 700;
}

/* TOPBAR STATUS (last update) */
.topbar-status {
    color: #9ca3af;
    font-size: 12px;
    margin: 0 8px;
}

/* THEME ve REFRESH BUTONLARI */
#btn-theme,
#btn-refresh {
    height: 38px;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 13px;
    background: rgba(255,255,255,0.05);
    color: #e5e7eb;
    border: 1.5px solid rgba(156, 163, 175, 0.25);
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
}

#btn-theme:hover,
#btn-refresh:hover {
    border-color: rgba(34, 211, 238, 0.5);
    color: #22d3ee;
    background: rgba(34, 211, 238, 0.06);
}

/* MOBILE */
@media (max-width: 1024px) {
    .topbar {
        padding: 10px 14px;
        gap: 12px;
        flex-wrap: wrap;
    }
    .topbar-center {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }
    .nav-tab-label {
        display: none;
    }
    .nav-tab {
        padding: 8px 12px;
    }
    .topbar-status,
    .store-selector-label {
        display: none;
    }
}

/* DARK MODE */
body.dark .topbar {
    background: #020617;
    border-bottom-color: #1e293b;
}

body.dark .nav-tab {
    background: rgba(255,255,255,0.02);
    color: #94a3b8;
}

body.dark .nav-tab:hover {
    color: #e2e8f0;
}

body.dark .nav-tab.active {
    color: #22d3ee;
}

body.dark .topbar-status {
    color: #64748b;
}

body.dark .topbar-icon-btn,
body.dark .topbar-avatar {
    background: rgba(255,255,255,0.02);
}

body.dark .store-selector-native {
    color: #fed7aa;
}

body.dark .store-selector-native option {
    background: #0f172a;
}

body.dark .topbar-badge {
    border-color: #020617;
}

body.dark #btn-theme,
body.dark #btn-refresh {
    background: rgba(255,255,255,0.03);
    border-color: rgba(71, 85, 105, 0.5);
}

/* ============================================================
   USER MENU
   ============================================================ */
.user-menu-wrapper {
    position: relative;
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #1f2937;
    border: 1.5px solid rgba(156, 163, 175, 0.25);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-header {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-menu-header #userMenuName {
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
}

.user-menu-role {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-menu-divider {
    border: none;
    border-top: 1px solid rgba(156, 163, 175, 0.15);
    margin: 4px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #d1d5db;
    font-size: 13px;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.user-menu-item:hover {
    background: rgba(255,255,255,0.06);
    color: #f9fafb;
}

.user-menu-logout {
    color: #f87171;
}

.user-menu-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

body.dark .user-menu {
    background: #0f172a;
    border-color: rgba(71, 85, 105, 0.4);
}

/* ============================================================
   EBAY PANEL (rate limit + upload)
   ============================================================ */
.ebay-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

/* EBAY KOTA WIDGET */
.ebay-quota-widget {
    flex: 1;
    min-width: 300px;
    max-width: 520px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

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

.ebay-quota-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.ebay-quota-ts {
    font-size: 10px;
    color: #9ca3af;
}

.quota-store-cards { display: flex; flex-direction: column; gap: 10px; }

.quota-store-card {
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fafafa;
}

.quota-store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.quota-store-name {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.quota-src-badge {
    font-size: 10px;
    color: #9ca3af;
    background: #f3f4f6;
    border-radius: 4px;
    padding: 1px 6px;
}

.quota-feed-row { margin-bottom: 8px; }
.quota-feed-row:last-child { margin-bottom: 0; }

.quota-feed-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.quota-feed-label { font-size: 11px; color: #6b7280; }

.quota-feed-nums {
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
    font-variant-numeric: tabular-nums;
}

.quota-bar-wrap {
    height: 5px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 3px;
}

.quota-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease, background-color 0.3s;
}
.quota-bar-fill.good     { background: #22c55e; }
.quota-bar-fill.warn     { background: #f59e0b; }
.quota-bar-fill.critical { background: #ef4444; }

.quota-reset-info { font-size: 10px; color: #9ca3af; }

.quota-feed-row.quota-critical .quota-feed-nums { color: #ef4444; }

.quota-loading { font-size: 12px; color: #9ca3af; text-align: center; padding: 8px 0; }
.quota-empty-row { font-size: 11px; color: #9ca3af; }

/* dark mode */
body.dark .ebay-quota-widget {
    background: #1e293b;
    border-color: #334155;
}
body.dark .quota-store-card {
    background: #0f172a;
    border-color: #1e293b;
}
body.dark .quota-store-name { color: #e2e8f0; }
body.dark .quota-src-badge  { background: #1e293b; color: #64748b; }
body.dark .quota-feed-label { color: #94a3b8; }
body.dark .quota-feed-nums  { color: #f1f5f9; }
body.dark .quota-bar-wrap   { background: #334155; }
body.dark .quota-reset-info { color: #64748b; }
body.dark .quota-feed-row.quota-critical .quota-feed-nums { color: #f87171; }

/* UPLOAD DURUMU WIDGET */
.upload-status-widget {
    flex: 1;
    min-width: 260px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.upload-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.upload-status-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b7280;
}

.upload-status-ts { font-size: 10px; color: #9ca3af; }

.upload-status-cards { display: flex; flex-direction: column; gap: 10px; }

.us-store-card {
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fafafa;
}

.us-store-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.us-store-name { font-size: 12px; font-weight: 600; color: #374151; }

.us-row {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.us-metric { display: flex; flex-direction: column; }

.us-metric-label {
    font-size: 10px;
    color: #9ca3af;
    margin-bottom: 2px;
}

.us-metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.1;
}

.us-pending { color: #3b82f6; }

.us-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.us-detail-label { font-size: 11px; color: #6b7280; }
.us-detail-val   { font-size: 11px; font-weight: 500; color: #374151; }

/* dark mode */
body.dark .upload-status-widget {
    background: #1e293b;
    border-color: #334155;
}

body.dark .us-store-card {
    background: #0f172a;
    border-color: #1e293b;
}

body.dark .us-store-name  { color: #e2e8f0; }
body.dark .us-metric-label { color: #64748b; }
body.dark .us-metric-value { color: #f1f5f9; }
body.dark .us-pending      { color: #60a5fa; }
body.dark .us-detail-label { color: #94a3b8; }
body.dark .us-detail-val   { color: #cbd5e1; }

/* eski ebay-rate-widget stilleri — geriye donuk uyumluluk */
.ebay-rate-widget {
    width: 220px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    flex-shrink: 0;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.ebay-rate-widget.rate-critical-blink {
    animation: blink-border 1s ease infinite;
}

@keyframes blink-border {
    0%, 100% { border-color: #fecaca; }
    50%       { border-color: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.3); }
}

.ebay-rate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ebay-rate-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b7280;
}

.ebay-rate-ts {
    font-size: 10px;
    color: #9ca3af;
}

.ebay-rate-bar-wrap {
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.ebay-rate-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease, background 0.4s ease;
}

.ebay-rate-bar.rate-good     { background: #22c55e; }
.ebay-rate-bar.rate-warn     { background: #eab308; }
.ebay-rate-bar.rate-critical { background: #ef4444; }

.ebay-rate-numbers {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.ebay-rate-sep  { font-size: 14px; color: #9ca3af; }
.ebay-rate-unit { font-size: 11px; color: #6b7280; font-weight: 500; }

.ebay-rate-reset {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.ebay-upload-widget {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.ebay-upload-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1f2937;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.ebay-upload-btn:hover:not(:disabled) {
    background: #374151;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.ebay-upload-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ebay-upload-badge {
    background: #f59e0b;
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

.ebay-upload-status         { font-size: 12px; color: #6b7280; min-height: 16px; }
.ebay-upload-status.success { color: #16a34a; }
.ebay-upload-status.error   { color: #dc2626; }

/* Dark mode */
body.dark .ebay-rate-widget,
body.dark .ebay-upload-widget {
    background: #1e293b;
    border-color: #334155;
}

body.dark .ebay-rate-numbers { color: #f1f5f9; }
body.dark .ebay-rate-bar-wrap { background: #334155; }

body.dark .ebay-upload-btn {
    background: #334155;
    color: #e2e8f0;
}

body.dark .ebay-upload-btn:hover:not(:disabled) {
    background: #475569;
}

/* ===== GUVENLI KAPATMA ===== */
.btn-shutdown {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-shutdown:hover { background: #b91c1c; }

.shutdown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.shutdown-modal {
    background: #0f172a;
    border: 1px solid #dc2626;
    border-radius: 14px;
    padding: 40px 48px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.shutdown-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    animation: sdPulse 1.5s ease-in-out infinite;
}

@keyframes sdPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.shutdown-modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 8px;
}

.shutdown-modal-sub {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 28px;
    line-height: 1.5;
}

.shutdown-status-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.shutdown-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #1e293b;
    border-radius: 8px;
    padding: 12px 20px;
    min-width: 90px;
}

.shutdown-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    font-weight: 600;
}

.shutdown-stat-val {
    font-size: 22px;
    font-weight: 700;
    color: #f1f5f9;
    font-variant-numeric: tabular-nums;
}
