*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
svg:not([width]){width:16px;height:16px}
svg{flex-shrink:0;overflow:visible}
html{font-size:15px;-webkit-text-size-adjust:100%}
body{font-family:'Vazirmatn',Tahoma,sans-serif;direction:rtl;background:#f4f6f9;color:#1a1a2e;min-height:100vh;line-height:1.6}

a{text-decoration:none;color:inherit}
button,input,select,textarea{font-family:inherit;font-size:inherit}
input,select,textarea{width:100%;padding:.55rem .75rem;border:1px solid #dde1e9;border-radius:8px;background:#fff;color:#1a1a2e;transition:border-color .15s}
input:focus,select:focus,textarea:focus{outline:none;border-color:#4f72d9;box-shadow:0 0 0 3px rgba(79,114,217,.12)}
textarea{resize:vertical;min-height:80px}
label{display:block;margin-bottom:.3rem;font-size:.85rem;color:#555;font-weight:500}
.form-group{margin-bottom:1rem}

.btn{display:inline-flex;align-items:center;gap:.4rem;padding:.55rem 1.2rem;border:none;border-radius:8px;cursor:pointer;font-weight:500;font-size:.9rem;transition:all .15s;white-space:nowrap}
.btn-primary{background:#4f72d9;color:#fff}.btn-primary:hover{background:#3d5ec7}
.btn-success{background:#28a745;color:#fff}.btn-success:hover{background:#218838}
.btn-danger{background:#dc3545;color:#fff}.btn-danger:hover{background:#c82333}
.btn-secondary{background:#6c757d;color:#fff}.btn-secondary:hover{background:#5a6268}
.btn-sm{padding:.35rem .75rem;font-size:.82rem}
.btn-outline{background:transparent;border:1px solid #4f72d9;color:#4f72d9}.btn-outline:hover{background:#4f72d9;color:#fff}

.topbar{background:#fff;border-bottom:1px solid #e8eaf0;padding:.7rem 1rem;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:100;box-shadow:0 1px 4px rgba(0,0,0,.06)}
.topbar-brand{font-weight:700;font-size:1.05rem;color:#4f72d9}
.topbar-nav{display:flex;gap:.3rem;align-items:center}
.nav-link{padding:.4rem .8rem;border-radius:6px;font-size:.88rem;color:#444;transition:all .15s;display:flex;align-items:center;gap:.3rem}
.nav-link:hover,.nav-link.active{background:#eef1fb;color:#4f72d9}
.nav-link svg{width:16px;height:16px}
.nav-logout{color:#dc3545}.nav-logout:hover{background:#fff0f0}

.main{max-width:960px;margin:1.5rem auto;padding:0 1rem}
.page-title{font-size:1.25rem;font-weight:700;margin-bottom:1.25rem;color:#1a1a2e;display:flex;align-items:center;gap:.5rem}

.card{background:#fff;border-radius:12px;border:1px solid #e8eaf0;padding:1.25rem;margin-bottom:1.25rem;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.card-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;padding-bottom:.75rem;border-bottom:1px solid #f0f2f8}
.card-title{font-size:1rem;font-weight:600;color:#1a1a2e}

.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:.75rem;margin-bottom:1.25rem}
.stat-card{background:#fff;border-radius:10px;border:1px solid #e8eaf0;padding:1rem;text-align:center}
.stat-value{font-size:1.3rem;font-weight:700;margin-bottom:.2rem}
.stat-label{font-size:.78rem;color:#888}
.stat-blue{color:#4f72d9}.stat-green{color:#28a745}.stat-red{color:#dc3545}.stat-amber{color:#e67e22}.stat-teal{color:#17a2b8}

table{width:100%;border-collapse:collapse;font-size:.88rem}
th{padding:.6rem .75rem;text-align:right;font-weight:600;background:#f8f9fd;color:#555;font-size:.82rem;border-bottom:2px solid #e8eaf0}
td{padding:.6rem .75rem;border-bottom:1px solid #f0f2f8;vertical-align:middle}
tr:last-child td{border-bottom:none}
tr:hover td{background:#fbfcff}
.table-wrap{overflow-x:auto}

.badge{display:inline-block;padding:.2rem .6rem;border-radius:20px;font-size:.75rem;font-weight:500}
.badge-green{background:#eafaf1;color:#1a7a3c}
.badge-red{background:#fdf0f0;color:#a12020}
.badge-blue{background:#eef1fb;color:#2d4fb8}
.badge-amber{background:#fef9ec;color:#8a5b0a}

.alert{padding:.75rem 1rem;border-radius:8px;margin-bottom:1rem;font-size:.9rem}
.alert-success{background:#eafaf1;border:1px solid #b7ebc8;color:#1a5c30}
.alert-danger{background:#fdf0f0;border:1px solid #f5c0c0;color:#8b1a1a}
.alert-info{background:#eef5fb;border:1px solid #b8d9f5;color:#1a4470}

.search-box{position:relative}
.search-box input{padding-right:2.2rem}
.search-box .icon{position:absolute;right:.65rem;top:50%;transform:translateY(-50%);color:#aaa;pointer-events:none}

.suggest-list{position:absolute;top:100%;right:0;left:0;background:#fff;border:1px solid #dde1e9;border-radius:0 0 8px 8px;max-height:200px;overflow-y:auto;z-index:200;box-shadow:0 4px 12px rgba(0,0,0,.1);display:none}
.suggest-list.open{display:block}
.suggest-item{padding:.55rem .75rem;cursor:pointer;font-size:.88rem;transition:background .1s}
.suggest-item:hover{background:#eef1fb;color:#4f72d9}

.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#4f72d9 0%,#6f42c1 100%)}
.login-card{background:#fff;border-radius:16px;padding:2rem;width:100%;max-width:380px;box-shadow:0 8px 32px rgba(0,0,0,.15)}
.login-logo{text-align:center;margin-bottom:1.5rem;font-size:1.5rem;font-weight:700;color:#4f72d9}

.amount-positive{color:#28a745;font-weight:600}
.amount-negative{color:#dc3545;font-weight:600}
.amount-neutral{color:#4f72d9;font-weight:600}

.flex{display:flex}.flex-between{justify-content:space-between}.flex-center{align-items:center}.gap-1{gap:.5rem}.gap-2{gap:1rem}
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}
.text-muted{color:#888;font-size:.85rem}
.text-center{text-align:center}

.history-list{list-style:none}
.history-item{display:flex;justify-content:space-between;align-items:flex-start;padding:.65rem 0;border-bottom:1px solid #f0f2f8}
.history-item:last-child{border-bottom:none}
.history-desc{font-size:.88rem}
.history-date{font-size:.78rem;color:#aaa;margin-top:.1rem}
.history-amount{font-size:.95rem;font-weight:600;text-align:left;min-width:90px}

.mobile-nav{display:none;position:fixed;bottom:0;right:0;left:0;background:#fff;border-top:1px solid #e8eaf0;z-index:200}
.mobile-nav a{flex:1;display:flex;flex-direction:column;align-items:center;padding:.5rem .25rem;font-size:.7rem;color:#888;gap:.25rem;transition:color .15s}
.mobile-nav a.active,.mobile-nav a:hover{color:#4f72d9}
.mobile-nav svg{width:22px;height:22px}
.mob-label{font-size:.65rem}

@media(max-width:600px){
  .topbar-nav{display:none}
  .mobile-nav{display:flex}
  .main{margin-bottom:70px;padding:0 .75rem;margin-top:1rem}
  .stats-grid{grid-template-columns:repeat(2,1fr)}
  th,td{padding:.5rem .5rem}
  .btn-sm-hide{display:none}
}

.settings-dropdown{position:absolute;left:0;top:calc(100% + 6px);background:#fff;border:1px solid #e8eaf0;border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.12);min-width:190px;z-index:500;padding:.4rem 0}
.settings-dropdown a{display:flex;align-items:center;gap:.6rem;padding:.6rem 1rem;font-size:.88rem;color:#333;transition:background .12s;text-decoration:none}
.settings-dropdown a:hover{background:#f4f6fb;color:#4f72d9}
.settings-divider{height:1px;background:#f0f2f8;margin:.3rem 0}