/* * پروژه: دستیار هوشمند مالی (PWA) - نسخه حرفه‌ای و توسعه‌یافته
 * معماری استایل: Component-Based Architecture (شبیه ساز کامل iOS 17)
 * تکنولوژی: Pure CSS (بدون فریم‌ورک، مجهز به متغیرهای پیشرفته)
 */

/* =========================================
   1. متغیرهای سیستم عامل (Design Tokens)
   ========================================= */
:root {
    /* ----- پالت رنگی پایه (Light Mode) ----- */
    --bg-base: #f2f2f7;
    /* پس زمینه اصلی سیستم */
    --bg-grouped: #f2f2f7;
    --surface-primary: #ffffff;
    --surface-secondary: #f2f2f7;
    --surface-tertiary: #e5e5ea;

    /* متریال شیشه‌ای (Glassmorphism) */
    --glass-thin: rgba(255, 255, 255, 0.4);
    --glass-regular: rgba(255, 255, 255, 0.65);
    --glass-thick: rgba(255, 255, 255, 0.85);
    --glass-blur: 24px;
    --glass-border: rgba(0, 0, 0, 0.05);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.6);

    /* رنگ‌های معنایی (Semantic iOS Colors) */
    --color-primary: #007aff;
    /* آبی */
    --color-success: #34c759;
    /* سبز */
    --color-warning: #ffcc00;
    /* زرد/نارنجی */
    --color-danger: #ff3b30;
    /* قرمز */
    --color-purple: #af52de;
    /* بنفش (سرمایه‌گذاری) */
    --color-indigo: #5856d6;
    --color-teal: #5ac8fa;

    /* تایپوگرافی و متون */
    --text-primary: #000000;
    --text-secondary: #8e8e93;
    --text-tertiary: #c7c7cc;
    --text-on-color: #ffffff;

    /* حاشیه‌ها و خطوط (Separators) */
    --border-color: rgba(60, 60, 67, 0.15);
    --divider-color: rgba(60, 60, 67, 0.1);

    /* سایه‌ها (Shadows) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    --shadow-float: 0 20px 40px rgba(0, 0, 0, 0.16);

    /* انیمیشن‌ها (Easings) */
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-fast: 0.15s var(--ease-smooth);
    --transition-normal: 0.3s var(--ease-smooth);

    /* شعاع حاشیه‌ها (Border Radius) */
    --radius-sm: 8px;
    --radius-md: 14px;
    /* استاندارد آیکون‌ها و دکمه‌های iOS */
    --radius-lg: 20px;
    --radius-xl: 32px;
}

/* ----- تم تاریک (Dark Mode) 자동 ----- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-base: #000000;
        --bg-grouped: #1c1c1e;
        --surface-primary: #1c1c1e;
        --surface-secondary: #2c2c2e;
        --surface-tertiary: #3a3a3c;

        --glass-thin: rgba(28, 28, 30, 0.4);
        --glass-regular: rgba(28, 28, 30, 0.65);
        --glass-thick: rgba(28, 28, 30, 0.85);
        --glass-border: rgba(255, 255, 255, 0.1);
        --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.05);

        --color-primary: #0a84ff;
        --color-success: #30d158;
        --color-warning: #ffd60a;
        --color-danger: #ff453a;
        --color-purple: #bf5af2;
        --color-indigo: #5e5ce6;
        --color-teal: #64d2ff;

        --text-primary: #ffffff;
        --text-secondary: #ebebf5;
        /* 60% opacity */
        --text-tertiary: #ebebf5;
        /* 30% opacity */

        --border-color: rgba(84, 84, 88, 0.65);
        --divider-color: rgba(84, 84, 88, 0.4);

        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.7);
        --shadow-float: 0 20px 40px rgba(0, 0, 0, 0.8);
    }
}

/* =========================================
   2. ریست کردن و اعمال رفتار Native App
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* غیرفعال کردن هایلایت آبی لمس در موبایل */
    -webkit-tap-highlight-color: transparent;
    /* جلوگیری از انتخاب متن (حیاتی برای Native Feel) */
    -webkit-user-select: none;
    user-select: none;
    /* جلوگیری از منوی پیش‌فرض مرورگر در لمس طولانی */
    -webkit-touch-callout: none;
}

/* بازگرداندن قابلیت انتخاب متن فقط برای فرم‌ها */
input,
textarea,
select {
    -webkit-user-select: auto;
    user-select: auto;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    direction: rtl;
    line-height: 1.4;
    font-size: 16px;

    /* قفل کردن زوم دو انگشتی و دبل‌تپ (Native App Lock) */
    touch-action: manipulation;

    /* مدیریت بریدگی‌ها و ناچ‌های آیفون */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);

    /* جلوگیری از اسکرول کشسانی کل صفحه وب (Bounce Effect فقط داخل کانتینرها باشد) */
    overscroll-behavior-y: none;
    overflow: hidden;
    /* کل صفحه ثابت است، کانتینر داخلی اسکرول می‌شود */
}

/* =========================================
   3. ساختار اصلی (Layout Container)
   ========================================= */
#app-root {
    position: relative;
    max-width: 500px;
    /* شبیه‌ساز عرض گوشی در دسکتاپ */
    margin: 0 auto;
    height: 100vh;
    height: 100dvh;
    /* داینامیک ویوپورت برای iOS 15+ */
    background: var(--bg-base);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* محتوای داخلی باید اسکرول شود نه کل روت */
    box-shadow: var(--shadow-float);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* فعال‌سازی اسکرول نرم آیفون */
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
    /* فضای برای منوی پایین */
    scrollbar-width: none;
    /* مخفی کردن اسکرول بار در فایرفاکس */
}

.main-content::-webkit-scrollbar {
    display: none;
    /* مخفی کردن اسکرول بار در کروم/سافاری */
}

/* =========================================
   4. سیستم گلس‌مورفیسم (Glassmorphism Core)
   ========================================= */
.glass-effect {
    background: var(--glass-regular);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-highlight), var(--shadow-sm);
}

.glass-heavy {
    background: var(--glass-thick);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
}

.glass-card {
    background: var(--surface-primary);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

/* =========================================
   5. هدر و منوی بالا (Navigation Bar)
   ========================================= */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    height: 60px;
    transition: all 0.3s;
}

.top-nav.scrolled {
    background: var(--glass-thick);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 0.5px solid var(--border-color);
}

.top-nav .nav-title {
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0;
    /* در حالت عادی مخفی است (مانند آیفون)، در اسکرول ظاهر می‌شود */
    transform: translateY(10px);
    transition: all 0.3s;
}

.top-nav.scrolled .nav-title {
    opacity: 1;
    transform: translateY(0);
}

.nav-actions button {
    background: transparent;
    border: none;
    color: var(--color-primary);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.nav-actions button:active {
    opacity: 0.5;
    background: var(--surface-tertiary);
}

/* عنوان بزرگ (Large Title iOS Style) */
.large-title {
    padding: 0 20px 10px;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    transition: opacity 0.2s;
}

/* =========================================
   6. کارت‌های آماری و داشبورد (Dashboards)
   ========================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 20px 20px;
}

.stat-card {
    background: var(--surface-primary);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-card.full-width {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--color-primary), var(--color-indigo));
    color: white;
    border: none;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.stat-card.full-width .stat-icon {
    background: rgba(255, 255, 255, 0.2);
}

.stat-card:not(.full-width) .stat-icon {
    background: var(--surface-tertiary);
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.stat-card.full-width .stat-value {
    font-size: 2.2rem;
}

/* =========================================
   7. لیست‌های استایل iOS (Grouped Lists)
   ========================================= */
.list-group {
    margin: 0 20px 24px;
    background: var(--surface-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.list-group-title {
    margin: 0 36px 8px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface-primary);
    position: relative;
    transition: background 0.2s;
    cursor: pointer;
}

.list-item:active {
    background: var(--surface-tertiary);
}

/* خط جداکننده بین آیتم‌ها */
.list-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    /* خط از لبه شروع نمی‌شود */
    right: 0;
    height: 0.5px;
    background-color: var(--divider-color);
}

.item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    margin-left: 16px;
    flex-shrink: 0;
}

/* رنگ‌های آیکون لیست */
.icon-red {
    background: var(--color-danger);
}

.icon-blue {
    background: var(--color-primary);
}

.icon-green {
    background: var(--color-success);
}

.icon-yellow {
    background: var(--color-warning);
}

.icon-purple {
    background: var(--color-purple);
}

.item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.item-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.item-value {
    font-size: 1rem;
    font-weight: 600;
    direction: ltr;
    /* برای اعداد پولی */
}

.item-value.positive {
    color: var(--color-success);
}

.item-value.negative {
    color: var(--text-primary);
}

.item-chevron {
    color: var(--text-tertiary);
    margin-right: 12px;
    font-size: 1.2rem;
}

/* =========================================
   8. فرم‌ها و کامپوننت‌های تعاملی (Inputs & Controls)
   ========================================= */
.form-section {
    padding: 20px;
}

.input-container {
    margin-bottom: 20px;
    position: relative;
}

.input-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    margin-right: 4px;
}

.native-input {
    width: 100%;
    background: var(--surface-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
    outline: none;
    -webkit-appearance: none;
    /* حذف استایل پیش‌فرض مرورگر */
}

.native-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.native-input::placeholder {
    color: var(--text-tertiary);
}

/* -- کلیدهای سوئیچ iOS (Toggle Switches) -- */
.ios-switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface-primary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.ios-switch {
    position: relative;
    width: 50px;
    height: 30px;
    background: var(--surface-tertiary);
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.3s;
}

.ios-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 26px;
    height: 26px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s var(--ease-spring);
}

.ios-switch.active {
    background: var(--color-success);
}

.ios-switch.active::after {
    transform: translateX(20px);
}

/* -- Segmented Control (تب‌های سوئیچ شونده iOS) -- */
.segmented-control {
    display: flex;
    background: var(--surface-tertiary);
    border-radius: 8px;
    padding: 2px;
    margin-bottom: 24px;
}

.segment-btn {
    flex: 1;
    padding: 6px 0;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.segment-btn.active {
    background: var(--surface-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* =========================================
   9. دکمه‌ها (Buttons)
   ========================================= */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-secondary {
    background: var(--surface-tertiary);
    color: var(--color-primary);
}

.btn-icon {
    display: inline-flex;
    width: auto;
    padding: 12px 24px;
    gap: 8px;
}

/* =========================================
   10. نوار ناوبری پایین (Bottom Tab Bar)
   ========================================= */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 500px;
    margin: 0 auto;
    height: calc(65px + env(safe-area-inset-bottom));
    background: var(--glass-thick);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-top: 0.5px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    padding-top: 8px;
    transition: color 0.2s;
}

.tab-item.active {
    color: var(--color-primary);
}

.tab-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
    transition: transform 0.3s var(--ease-spring);
}

.tab-item:active .tab-icon {
    transform: scale(0.8);
}

.tab-label {
    font-size: 0.65rem;
    font-weight: 500;
}

/* -- دکمه پاپ‌آپ افزودن در وسط (FAB) -- */
.fab-wrapper {
    position: relative;
    top: -20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fab-button {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #007aff, #5ac8fa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.4);
    border: 4px solid var(--bg-base);
    /* ایجاد حاشیه دور دکمه برای جدا شدن از نوار */
    transition: transform 0.2s var(--ease-spring);
    cursor: pointer;
}

.fab-button:active {
    transform: scale(0.85) rotate(45deg);
    /* افکت چرخش هنگام فشردن */
}

/* =========================================
   11. پاپ‌آپ‌ها و Bottom Sheets (مانند Modal های iOS)
   ========================================= */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.bottom-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 500px;
    margin: 0 auto;
    background: var(--surface-primary);
    border-radius: 32px 32px 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    z-index: 2001;
    transform: translateY(100%);
    transition: transform 0.4s var(--ease-spring);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
}

.bottom-sheet.active {
    transform: translateY(0);
}

/* خط تیره بالای منوی کشویی (Drag Handle) */
.drag-handle {
    width: 40px;
    height: 5px;
    background: var(--text-tertiary);
    border-radius: 5px;
    margin: 0 auto 20px;
    opacity: 0.5;
}

.sheet-title {
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
}

/* =========================================
   12. دیالوگ‌های هشدار (iOS Alerts)
   ========================================= */
.ios-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.ios-alert-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.ios-alert {
    width: 270px;
    background: var(--glass-thick);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    text-align: center;
    transform: scale(1.1);
    opacity: 0;
    transition: all 0.3s var(--ease-spring);
    overflow: hidden;
}

.ios-alert-overlay.active .ios-alert {
    transform: scale(1);
    opacity: 1;
}

.ios-alert-content {
    padding: 20px 16px;
}

.ios-alert-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.ios-alert-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ios-alert-buttons {
    display: flex;
    border-top: 0.5px solid var(--border-color);
}

.ios-alert-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    color: var(--color-primary);
    cursor: pointer;
}

.ios-alert-btn.bold {
    font-weight: 600;
}

.ios-alert-btn:not(:last-child) {
    border-left: 0.5px solid var(--border-color);
    /* چپ چون راست‌چین است */
}

.ios-alert-btn:active {
    background: var(--surface-tertiary);
}

/* =========================================
   13. اسکلت‌های بارگذاری (Skeleton / Shimmer)
   ========================================= */
.skeleton {
    background: var(--surface-tertiary);
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    animation: shimmer 1.5s infinite;
}

@media (prefers-color-scheme: dark) {
    .skeleton::after {
        background: linear-gradient(90deg,
                transparent,
                rgba(255, 255, 255, 0.1),
                transparent);
    }
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* =========================================
   14. انیمیشن‌های ترانزیشن صفحات (Page Transitions)
   ========================================= */
.page-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(-20px);
    /* حرکت از چپ به راست */
    pointer-events: none;
    transition: all 0.4s var(--ease-smooth);
    padding-top: 60px;
    /* جای هدر */
}

.page-view.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    z-index: 10;
}

/* انیمیشن پاپ (ورود آیتم‌ها به لیست) */
.animate-pop-in {
    animation: popIn 0.5s var(--ease-spring) forwards;
    opacity: 0;
    transform: scale(0.9);
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================================
   15. گراف‌ها و چارت‌های CSS (محل قرارگیری)
   ========================================= */
.chart-container {
    width: 100%;
    height: 200px;
    background: var(--surface-primary);
    border-radius: var(--radius-lg);
    margin: 20px 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.bar-fill {
    width: 30px;
    background: var(--color-primary);
    border-radius: 6px 6px 0 0;
    transition: height 1s var(--ease-spring);
    min-height: 5%;
}

.bar-label {
    margin-top: 8px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* =========================================
   16. المان‌های اضافی و Micro-interactions
   ========================================= */
/* نشانگر وضعیت باتری/نت ورک در هدر - شبیه سازی ناچ داینامیک */
.dynamic-island-placeholder {
    width: 120px;
    height: 30px;
    background: black;
    border-radius: 20px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: none;
    /* فقط برای دمو فعال می‌شود */
}

/* Badge نوتیفیکیشن برای منوی پایین */
.nav-badge {
    position: absolute;
    top: 2px;
    right: 20px;
    background: var(--color-danger);
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid var(--glass-thick);
}