/* Local Vazirmatn Font Definitions (100% Offline & Fast) */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../vendor/fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../vendor/fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../vendor/fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../vendor/fonts/Vazirmatn-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../vendor/fonts/Vazirmatn-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-dark: #090e0e;
    --bg-surface: #0f1616;
    --card-bg: rgba(18, 27, 27, 0.75);
    --card-bg-solid: #121c1c;
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(0, 230, 153, 0.3);
    
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-emerald: #00e699;
    --accent-emerald-dark: #00b377;
    --accent-emerald-glow: rgba(0, 230, 153, 0.25);
    
    --accent-purple: #8b5cf6;
    --accent-purple-light: #a78bfa;
    --accent-purple-glow: rgba(139, 92, 246, 0.25);
    
    --accent-lime: #ccff00;
    
    --pill-bg: rgba(255, 255, 255, 0.05);
    --pill-hover: rgba(255, 255, 255, 0.1);
    
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

/* ==========================================================================
   GLOBAL MACOS-STYLE LUXURY FLOATING SCROLLBARS (For Windows & All Browsers)
   ========================================================================== */
::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
    background-color: transparent !important;
}

::-webkit-scrollbar-track {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 4px 0 !important;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 9999px !important;
    border: 1px solid transparent !important;
    background-clip: padding-box !important;
    transition: background-color 0.2s ease, box-shadow 0.2s ease !important;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 230, 153, 0.55) !important;
    box-shadow: 0 0 10px rgba(0, 230, 153, 0.4) !important;
}

::-webkit-scrollbar-thumb:active {
    background: rgba(0, 230, 153, 0.85) !important;
}

::-webkit-scrollbar-corner {
    background: transparent !important;
}

/* Eliminate chunky Windows arrow buttons at scrollbar ends */
::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Universal modern styling for all native select boxes on Windows */
select.velvet-inset-input,
select.goldex-filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='14' height='14' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 10px center !important;
    padding-left: 28px !important;
    cursor: pointer;
}

select.velvet-inset-input option,
select.goldex-filter-select option {
    background-color: #0b111a !important;
    color: #f1f5f9 !important;
    padding: 8px 12px !important;
}

body, input, button, select, textarea, table, p, h1, h2, h3, h4, h5, h6, span, label, div, a {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Ensure FontAwesome Icons preserve their font family */
i, .fa, .fas, .far, .fal, .fab, .fa-solid, .fa-regular, .fa-light, .fa-thin, .fa-duotone, .fa-brands {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
}

/* GLOBAL REMOVAL OF DEFAULT BROWSER NUMBER INPUT SPINNERS ACROSS ALL INPUTS */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none !important; 
  margin: 0 !important; 
}
input[type=number] {
  -moz-appearance: textfield !important;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    position: relative;
    box-sizing: border-box;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 230, 153, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    padding: 20px 24px;
    gap: 20px;
    overflow-x: hidden;
    align-items: flex-start;
    box-sizing: border-box;
}

@media (max-width: 1200px) {
    .app-container {
        padding: 16px 18px;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 10px 10px;
        gap: 10px;
    }
}

/* Floating Adaptive Sidebar & Layout Spacer */
.sidebar-wrapper {
    width: 62px;
    min-width: 62px;
    max-width: 62px;
    flex: 0 0 62px;
    flex-shrink: 0;
    align-self: stretch;
    box-sizing: border-box;
    position: relative;
    display: block;
    margin: 0;
    padding: 0;
}

.sidebar {
    width: 62px;
    min-width: 62px;
    max-width: 62px;
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0 8px 0;
    height: calc(100vh - 28px);
    max-height: calc(100vh - 28px);
    position: fixed;
    top: 14px;
    right: 24px;
    z-index: 1050;
    overflow: hidden;
    transition: right 0.15s ease, top 0.2s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.sidebar.sidebar-scrolled {
    background: rgba(10, 15, 24, 0.97);
    border-color: rgba(255, 255, 255, 0.13);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.9), 0 0 18px rgba(0, 230, 153, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    gap: clamp(2px, 0.8vh, 8px);
    padding: 0;
    overflow: hidden;
}
.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    width: 100%;
    height: clamp(34px, 4.8vh, 46px);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    background: transparent;
    flex-shrink: 0;
    font-size: clamp(1.15rem, 1.8vh, 1.35rem);
}

.nav-item:hover {
    color: var(--text-primary);
    background: transparent;
}

.nav-item.active {
    background: transparent;
    color: inherit;
}

/* Main Content Area */
.main-wrapper {
    flex: 1 1 0%;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* 3D Soft Neumorphic Velvet Cards (Global Standard) */
.velvet-card-3d {
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, #131b26, #0d131e);
    box-shadow: 14px 14px 34px #06090e, -8px -8px 22px rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.065);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.velvet-card-3d:hover {
    border-color: rgba(0, 230, 153, 0.28);
    box-shadow: 18px 18px 42px #05070c, -10px -10px 28px rgba(0, 230, 153, 0.04);
}
.dashboard-main > .velvet-card-3d,
.main-wrapper > .velvet-card-3d {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* Global Responsive Table Wrapper & Sleek Scrollbar */
.goldex-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box !important;
}
.goldex-table-wrapper::-webkit-scrollbar {
    height: 6px;
}
.goldex-table-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}
.goldex-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 4px;
}
.goldex-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 230, 153, 0.45);
}

/* Top Header */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1100px) {
    #tehranTimeHeaderPill {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--text-primary);
    text-decoration: none;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-emerald), #00b377);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 800;
}

.search-box {
    position: relative;
    width: 380px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.search-box input:focus {
    border-color: var(--accent-emerald);
    background: rgba(255, 255, 255, 0.08);
}

.search-box .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.user-greeting {
    font-weight: 600;
    font-size: 1.05rem;
}

.avatar-wrapper {
    position: relative;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-emerald);
}

.online-status {
    width: 10px;
    height: 10px;
    background: var(--accent-emerald);
    border-radius: 50%;
    position: absolute;
    bottom: 2px;
    right: 2px;
    border: 2px solid var(--bg-dark);
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Left Grid Content */
.grid-left {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Filter Pills */
.filter-pills {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.pill-btn {
    padding: 10px 24px;
    border-radius: var(--radius-full);
    background: var(--pill-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pill-btn:hover {
    background: var(--pill-hover);
    color: var(--text-primary);
}

.pill-btn.active {
    background: var(--accent-emerald);
    color: #051410;
    border-color: var(--accent-emerald);
    box-shadow: 0 4px 15px var(--accent-emerald-glow);
}

/* Chart Cards */
.card-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0 24px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.view-all {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.view-all:hover {
    color: var(--accent-emerald);
}

/* Revenue Flow Chart Card */
.revenue-card {
    padding-bottom: 20px;
}

.chart-container {
    position: relative;
    padding: 20px;
    height: 240px;
}

/* Middle Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
}

.expenses-donut-card {
    grid-column: span 1;
    padding: 20px;
}

.donut-layout {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

.donut-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
}

.donut-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.donut-amount {
    font-size: 1.1rem;
    font-weight: 800;
}

.donut-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    flex-direction: column;
}

.legend-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-val {
    font-size: 0.9rem;
    font-weight: 700;
    margin-left: 16px;
}

.stat-widget {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-widget-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 12px 0 4px 0;
}

.stat-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge-pill {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-pill.emerald {
    background: rgba(0, 230, 153, 0.15);
    color: var(--accent-emerald);
}

.badge-pill.purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple-light);
}

/* Right Grid Column */
.grid-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Credit Card Widget */
.my-card-widget {
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.credit-card-preview {
    background: linear-gradient(135deg, rgba(0, 230, 153, 0.25) 0%, rgba(139, 92, 246, 0.35) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 14px;
    position: relative;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.balance-title {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}

.balance-amount {
    font-size: 1.6rem;
    font-weight: 800;
}

.add-card-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.add-card-btn:hover {
    transform: scale(1.08);
}

.card-number {
    font-size: 0.95rem;
    letter-spacing: 2px;
    font-family: monospace;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 6px;
}

.card-exp {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Transactions List */
.transactions-widget {
    padding: 20px;
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 14px;
}

.transaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tx-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tx-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.tx-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.tx-amount {
    font-size: 0.9rem;
    font-weight: 700;
}

/* Bottom Grid Pair */
.bottom-right-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.friends-widget, .spending-widget {
    padding: 16px;
}

.widget-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.3;
}

.avatar-stack {
    display: flex;
    margin-top: 12px;
}

.stack-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--card-bg-solid);
    margin-left: -8px;
}

.stack-img:first-child {
    margin-left: 0;
}

.sparkline-container {
    height: 45px;
    margin-top: 10px;
}
