/* PeerTupeer — Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

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

body { font-family: 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }

/* ── Base link reset — prevent blue underlined links ─────────────────── */
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font-weight: 600; border-radius: 0.75rem; transition: all 0.15s; cursor: pointer; border: none; text-decoration: none; font-family: inherit; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #84cc16; color: white; }
.btn-primary:hover { background: #65a30d; color: white; }
.btn-secondary { background: #f3f4f6; color: #1f2937; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-outline { border: 2px solid #84cc16; color: #65a30d; background: transparent; }
.btn-outline:hover { background: #f7fee7; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { color: #6b7280; background: transparent; }
.btn-ghost:hover { background: #f3f4f6; color: #111827; }
.btn-sm  { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
.btn-md  { padding: 0.625rem 1.25rem; font-size: 0.875rem; }
.btn-lg  { padding: 0.875rem 1.75rem; font-size: 1rem; }

/* ── Inputs ──────────────────────────────────────────────────────────── */
.input { width: 100%; padding: 0.75rem 1rem; border: 1.5px solid #d1d5db; border-radius: 0.75rem; background: white; color: #111827; font-size: 0.875rem; font-family: inherit; transition: border-color 0.15s, box-shadow 0.15s; outline: none; }
.input:focus { border-color: #84cc16; box-shadow: 0 0 0 3px rgba(132,204,22,0.15); }
.input::placeholder { color: #9ca3af; }
.input-error { border-color: #f87171; }
.input-error:focus { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
.label { display: block; font-size: 0.8rem; font-weight: 600; color: #374151; margin-bottom: 0.375rem; }

/* ── Cards ───────────────────────────────────────────────────────────── */
.card { background: white; border-radius: 1rem; border: 1px solid #f3f4f6; box-shadow: 0 1px 3px rgba(0,0,0,0.08); padding: 1.5rem; }
.stat-card { background: white; border-radius: 1rem; border: 1px solid #f3f4f6; box-shadow: 0 1px 3px rgba(0,0,0,0.08); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }

/* ── Badges ──────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.625rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-primary { background: #ecfccb; color: #3f6212; }
.badge-neutral { background: #f3f4f6; color: #4b5563; }
.badge-purple  { background: #f3e8ff; color: #6b21a8; }
.badge-orange  { background: #ffedd5; color: #9a3412; }

/* ── Trade status badges ─────────────────────────────────────────────── */
.status-pending      { display: inline-flex; align-items: center; padding: 0.2rem 0.625rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; background: #fef9c3; color: #854d0e; }
.status-under_review { display: inline-flex; align-items: center; padding: 0.2rem 0.625rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; background: #dbeafe; color: #1d4ed8; }
.status-processing   { display: inline-flex; align-items: center; padding: 0.2rem 0.625rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; background: #f3e8ff; color: #6b21a8; }
.status-approved     { display: inline-flex; align-items: center; padding: 0.2rem 0.625rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; background: #ecfccb; color: #3f6212; }
.status-completed    { display: inline-flex; align-items: center; padding: 0.2rem 0.625rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; background: #dcfce7; color: #15803d; }
.status-rejected     { display: inline-flex; align-items: center; padding: 0.2rem 0.625rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; background: #fee2e2; color: #991b1b; }
.status-disputed     { display: inline-flex; align-items: center; padding: 0.2rem 0.625rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; background: #ffedd5; color: #9a3412; }
.status-active       { display: inline-flex; align-items: center; padding: 0.2rem 0.625rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; background: #dcfce7; color: #15803d; }
.status-suspended    { display: inline-flex; align-items: center; padding: 0.2rem 0.625rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; background: #fee2e2; color: #991b1b; }
.status-open         { display: inline-flex; align-items: center; padding: 0.2rem 0.625rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; background: #dbeafe; color: #1d4ed8; }
.status-resolved     { display: inline-flex; align-items: center; padding: 0.2rem 0.625rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; background: #dcfce7; color: #15803d; }
.status-closed       { display: inline-flex; align-items: center; padding: 0.2rem 0.625rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; background: #f3f4f6; color: #4b5563; }

/* ── Tables ──────────────────────────────────────────────────────────── */
.table { width: 100%; font-size: 0.875rem; border-collapse: collapse; }
.table thead tr { background: #f9fafb; border-bottom: 1px solid #f3f4f6; }
.table th { padding: 0.75rem 1.25rem; text-align: left; font-size: 0.7rem; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; }
.table td { padding: 1rem 1.25rem; color: #374151; border-bottom: 1px solid #f9fafb; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #f9fafb; }

/* ── Nav links ───────────────────────────────────────────────────────── */
.nav-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0.75rem; border-radius: 0.75rem; font-size: 0.875rem; font-weight: 500; color: #6b7280; text-decoration: none; transition: all 0.15s; }
.nav-link:hover { color: #111827; background: #f9fafb; }
.nav-link-active { background: #f7fee7; color: #4d7c0f; }
.nav-link-active:hover { background: #ecfccb; color: #3f6212; }

/* ── Utilities ───────────────────────────────────────────────────────── */
.bg-white { background-color: white; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-900 { background-color: #111827; }
.text-gray-900 { color: #111827; }
.text-gray-700 { color: #374151; }
.text-gray-600 { color: #4b5563; }
.text-gray-500 { color: #6b7280; }
.text-gray-400 { color: #9ca3af; }
.text-white { color: white; }
.text-lime-600 { color: #65a30d; }
.text-lime-700 { color: #4d7c0f; }
.text-red-500 { color: #ef4444; }
.text-red-600 { color: #dc2626; }
.text-green-600 { color: #16a34a; }
.font-sans { font-family: 'Inter', system-ui, sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.antialiased { -webkit-font-smoothing: antialiased; }
.min-h-screen { min-height: 100vh; }
.h-screen { height: 100vh; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }
.gap-16 { gap: 4rem; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-12 { padding: 3rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-24 { padding-top: 6rem; padding-bottom: 6rem; }
.pt-20 { padding-top: 5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-20 { margin-top: 5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-8 { width: 2rem; }
.w-9 { width: 2.25rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-14 { width: 3.5rem; }
.w-16 { width: 4rem; }
.w-60 { width: 15rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.max-w-md { max-width: 28rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-7xl { max-width: 80rem; }
.min-w-0 { min-width: 0; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid #e5e7eb; }
.border-b { border-bottom: 1px solid #e5e7eb; }
.border-t { border-top: 1px solid #e5e7eb; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-800 { border-color: #1f2937; }
.border-lime-200 { border-color: #d9f99d; }
.shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.tracking-tight { letter-spacing: -0.025em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.cursor-pointer { cursor: pointer; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.flex-shrink-0 { flex-shrink: 0; }
.hidden { display: none; }
.block { display: block; }
.inline-flex { display: inline-flex; }
.transition-all { transition: all 0.15s; }
.transition-colors { transition: color 0.15s, background-color 0.15s, border-color 0.15s; }
.transition-shadow { transition: box-shadow 0.15s; }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1); }
.hover\:bg-gray-50:hover { background: #f9fafb; }
.hover\:bg-gray-100:hover { background: #f3f4f6; }
.hover\:bg-lime-50:hover { background: #f7fee7; }
.hover\:bg-lime-100:hover { background: #ecfccb; }
.hover\:bg-lime-200:hover { background: #d9f99d; }
.hover\:bg-red-50:hover { background: #fef2f2; }
.hover\:bg-gray-800:hover { background: #1f2937; }
.hover\:text-white:hover { color: white; }
.hover\:text-gray-900:hover { color: #111827; }
.hover\:text-lime-700:hover { color: #4d7c0f; }
.hover\:text-red-400:hover { color: #f87171; }
.hover\:text-red-600:hover { color: #dc2626; }
.hover\:underline:hover { text-decoration: underline; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.bg-clip-text { -webkit-background-clip: text; background-clip: text; }
.text-transparent { color: transparent; }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.from-lime-600 { --tw-gradient-from: #65a30d; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(101,163,13,0)); }
.to-lime-400 { --tw-gradient-to: #a3e635; }
.backdrop-blur-md { backdrop-filter: blur(12px); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .md\:py-24 { padding-top: 6rem; padding-bottom: 6rem; }
    .md\:text-4xl { font-size: 2.25rem; }
    .md\:text-5xl { font-size: 3rem; }
    .md\:text-6xl { font-size: 3.75rem; }
    .md\:flex-row { flex-direction: row; }
    .md\:col-span-1 { grid-column: span 1; }
    .md\:h-20 { height: 5rem; }
}
@media (min-width: 1024px) {
    .lg\:flex { display: flex; }
    .lg\:hidden { display: none; }
    .lg\:w-1\/2 { width: 50%; }
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .lg\:col-span-2 { grid-column: span 2; }
    .lg\:text-7xl { font-size: 4.5rem; }
}

/* ── File upload drop zone ───────────────────────────────────────────── */
.drop-zone { border: 2px dashed #d1d5db; border-radius: 0.75rem; padding: 1.5rem; text-align: center; cursor: pointer; transition: all 0.15s; }
.drop-zone:hover, .drop-zone.drag-over { border-color: #84cc16; background: #f7fee7; }
.drop-zone input[type="file"] { display: none; }

/* ── Alert boxes ─────────────────────────────────────────────────────── */
.alert { padding: 0.75rem 1rem; border-radius: 0.75rem; font-size: 0.875rem; font-weight: 500; margin-bottom: 1rem; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

/* ── Scrollbar ───────────────────────────────────────────────────────── */
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ── Payout preview ──────────────────────────────────────────────────── */
.payout-preview { background: #f7fee7; border: 1px solid #d9f99d; border-radius: 0.75rem; padding: 1rem; }
.payout-row { display: flex; justify-content: space-between; padding: 0.375rem 0; font-size: 0.875rem; border-bottom: 1px solid #ecfccb; }
.payout-row:last-child { border-bottom: none; font-weight: 700; font-size: 1rem; }
.payout-row .payout-label { color: #4b5563; }
.payout-row .payout-value { font-weight: 600; color: #111827; }
.payout-row.total .payout-value { color: #4d7c0f; }

/* ── Mobile navigation ───────────────────────────────────────────────── */

/* Bottom nav bar — mobile only */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: white;
    border-top: 1px solid #f3f4f6;
    z-index: 30;
    padding: 0 0.5rem;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}
.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 0.2rem;
    padding: 0.5rem 0.25rem;
    border-radius: 0.75rem;
    font-size: 0.625rem;
    font-weight: 600;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.15s;
    min-width: 0;
}
.mobile-bottom-nav a.active,
.mobile-bottom-nav a:active {
    color: #4d7c0f;
    background: #f7fee7;
}
.mobile-bottom-nav a svg {
    width: 1.375rem;
    height: 1.375rem;
    flex-shrink: 0;
}
.mobile-bottom-nav .nav-fab {
    width: 3rem;
    height: 3rem;
    background: #84cc16;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(132,204,22,0.4);
    margin-bottom: 0.75rem;
    flex-shrink: 0;
    color: white;
}
.mobile-bottom-nav .nav-fab svg {
    width: 1.375rem;
    height: 1.375rem;
}

/* Add bottom padding on mobile so content isn't hidden behind bottom nav */
@media (max-width: 767px) {
    .mobile-bottom-nav { display: flex; align-items: center; }
    .mobile-page-content { padding-bottom: 80px !important; }
    /* Make cards full-width on mobile */
    .card { border-radius: 0.875rem; }
    /* Tighten grid on mobile */
    .grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    /* Stat cards stack nicely */
    .stat-card { padding: 1rem; }
    /* Tables scroll horizontally */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    /* Reduce main padding on mobile */
    main.flex-1.p-6 { padding: 1rem 1rem 5rem 1rem; }
    /* Hide desktop-only elements */
    .md\:inline-flex { display: none !important; }
}

/* Sidebar slide-in transition */
#mobileSidebar {
    transform: translateX(-100%);
}
#mobileSidebar.open {
    transform: translateX(0);
}

/* Prevent body scroll when mobile sidebar is open */
body.sidebar-open {
    overflow: hidden;
}

/* md:hidden utility for mobile sidebar */
@media (min-width: 768px) {
    #mobileSidebar,
    #mobileSidebarBackdrop,
    .mobile-bottom-nav { display: none !important; }
}

/* Responsive flex layout fix */
@media (max-width: 767px) {
    .flex.h-screen.overflow-hidden { height: auto; min-height: 100vh; overflow: visible; }
    .flex-1.flex.flex-col.min-w-0.overflow-auto { overflow: visible; height: auto; }
}
