/* =========================================================
   سامانه مدیریت ساختمان - استایل اصلی
   طراحی مدرن، ساده و بزرگ برای کاربران غیرحرفه‌ای
   ========================================================= */

:root{
  --bm-primary:#6C5CE7;
  --bm-primary-dark:#5849c2;
  --bm-secondary:#00CEC9;
  --bm-success:#00B894;
  --bm-warning:#FDCB6E;
  --bm-danger:#FF6B6B;
  --bm-bg:#F4F5FB;
  --bm-card-radius:20px;
  --bm-shadow: 0 10px 30px rgba(108,92,231,.08);
}

*{ box-sizing:border-box; }

body{
  font-family:'Vazirmatn', Tahoma, sans-serif;
  background:var(--bm-bg);
  color:#2d3436;
  font-size:16px;
}

a{ text-decoration:none; }

/* ---------- صفحه ورود ---------- */
.auth-wrapper{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#6C5CE7 0%,#00CEC9 100%);
  padding:20px;
}
.auth-card{
  background:#fff;
  border-radius:28px;
  box-shadow:0 25px 60px rgba(0,0,0,.2);
  width:100%;
  max-width:420px;
  padding:40px 32px;
  text-align:center;
}
.auth-card .logo-circle{
  width:78px;height:78px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--bm-primary),var(--bm-secondary));
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 18px;
  font-size:36px;color:#fff;
  box-shadow:var(--bm-shadow);
}
.auth-card h1{ font-size:22px; font-weight:800; margin-bottom:4px;}
.auth-card p.subtitle{ color:#8395a7; margin-bottom:26px; font-size:14px;}

.form-control-lg-custom{
  border-radius:14px;
  padding:14px 16px;
  border:2px solid #eef0fb;
  font-size:17px;
  background:#fafbff;
}
.form-control-lg-custom:focus{
  border-color:var(--bm-primary);
  box-shadow:0 0 0 4px rgba(108,92,231,.12);
  background:#fff;
}
label.bm-label{ font-weight:700; font-size:14px; margin-bottom:8px; display:block; color:#2d3436;}

.btn-bm-primary{
  background:linear-gradient(135deg,var(--bm-primary),#8579f0);
  border:none;
  color:#fff;
  border-radius:14px;
  padding:14px;
  font-weight:800;
  font-size:17px;
  width:100%;
  transition:.2s;
  box-shadow:0 10px 20px rgba(108,92,231,.25);
}
.btn-bm-primary:hover{ transform:translateY(-2px); color:#fff; box-shadow:0 14px 26px rgba(108,92,231,.35);}

.btn-bm-outline{
  border:2px solid var(--bm-primary);
  color:var(--bm-primary);
  background:#fff;
  border-radius:14px;
  padding:12px 20px;
  font-weight:700;
}
.btn-bm-outline:hover{ background:var(--bm-primary); color:#fff; }

.btn-bm-success{ background:linear-gradient(135deg,#00b894,#55efc4); border:none; color:#fff; border-radius:14px; font-weight:800; padding:12px 20px;}
.btn-bm-danger{ background:linear-gradient(135deg,#ff6b6b,#ff9a9a); border:none; color:#fff; border-radius:14px; font-weight:800; padding:12px 20px;}
.btn-bm-success:hover, .btn-bm-danger:hover{ color:#fff; opacity:.9; }

/* ---------- لایوت اصلی (سایدبار + محتوا) ---------- */
.bm-app{ display:flex; min-height:100vh; }

.bm-sidebar{
  width:260px;
  background:#fff;
  border-left:1px solid #eef0f5;
  padding:24px 16px;
  position:sticky; top:0; height:100vh; overflow-y:auto;
  flex-shrink:0;
}
.bm-sidebar .brand{
  display:flex; align-items:center; gap:10px;
  margin-bottom:28px; padding:0 6px;
}
.bm-sidebar .brand .logo-circle{
  width:44px;height:44px;border-radius:14px;
  background:linear-gradient(135deg,var(--bm-primary),var(--bm-secondary));
  display:flex;align-items:center;justify-content:center;color:#fff;font-size:20px;
}
.bm-sidebar .brand strong{ font-size:15px; }
.bm-sidebar .brand small{ display:block; color:#8395a7; font-size:11px;}

.bm-nav-link{
  display:flex; align-items:center; gap:12px;
  padding:13px 14px; border-radius:14px;
  color:#57606f; font-weight:600; font-size:15px;
  margin-bottom:6px;
}
.bm-nav-link i{ font-size:20px; width:24px; text-align:center; }
.bm-nav-link:hover{ background:#f4f2ff; color:var(--bm-primary); }
.bm-nav-link.active{ background:linear-gradient(135deg,var(--bm-primary),#8579f0); color:#fff; box-shadow:0 8px 18px rgba(108,92,231,.28);}
.bm-nav-section-title{ font-size:12px; color:#b2bec3; font-weight:700; margin:18px 8px 8px; }

.bm-content{ flex:1; min-width:0; }
.bm-topbar{
  background:#fff; border-bottom:1px solid #eef0f5;
  padding:16px 26px; display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; z-index:20;
}
.bm-topbar h4{ margin:0; font-weight:800; font-size:19px;}
.bm-user-chip{ display:flex; align-items:center; gap:10px; background:#f4f5fb; padding:8px 14px; border-radius:40px;}
.bm-user-chip .avatar{ width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--bm-primary),var(--bm-secondary));display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:14px;}

.bm-main{ padding:24px; max-width:1300px; margin:0 auto; }

/* ---------- کارت‌ها ---------- */
.bm-card{
  background:#fff; border-radius:var(--bm-card-radius);
  box-shadow:var(--bm-shadow);
  padding:24px;
  border:1px solid #f1f2fb;
  margin-bottom:22px;
}
.bm-card h5.card-title{ font-weight:800; margin-bottom:18px; font-size:17px;}

.bm-stat-card{
  border-radius:20px; padding:22px; color:#fff; position:relative; overflow:hidden;
  box-shadow:var(--bm-shadow);
}
.bm-stat-card i.bg-icon{ position:absolute; font-size:80px; opacity:.18; left:10px; bottom:-10px; }
.bm-stat-card .value{ font-size:28px; font-weight:800; }
.bm-stat-card .label{ font-size:14px; opacity:.9; }
.stat-purple{ background:linear-gradient(135deg,#6C5CE7,#8579f0); }
.stat-teal{ background:linear-gradient(135deg,#00CEC9,#55efc4); }
.stat-orange{ background:linear-gradient(135deg,#FD9644,#FDCB6E); }
.stat-pink{ background:linear-gradient(135deg,#FF6B6B,#FF9FF3); }
.stat-blue{ background:linear-gradient(135deg,#2E86DE,#54A0FF); }

.badge-bm{ border-radius:30px; padding:7px 14px; font-weight:700; font-size:12.5px; }
.badge-bm-success{ background:#e5fff6; color:#00b894; }
.badge-bm-warning{ background:#fff7e5; color:#e1a100; }
.badge-bm-danger{ background:#ffefef; color:#ff6b6b; }
.badge-bm-gray{ background:#f1f2f6; color:#747d8c; }
.badge-bm-primary{ background:#f0eefe; color:var(--bm-primary); }

.table-bm{ width:100%; border-collapse:separate; border-spacing:0 10px; }
.table-bm thead th{ color:#8395a7; font-size:13px; font-weight:700; padding:0 16px 8px; text-align:right;}
.table-bm tbody tr{ background:#fafbff; }
.table-bm tbody td{ padding:16px; vertical-align:middle; font-size:14.5px; }
.table-bm tbody tr td:first-child{ border-radius:14px 0 0 14px; }
.table-bm tbody tr td:last-child{ border-radius:0 14px 14px 0; }

.empty-state{ text-align:center; padding:50px 20px; color:#8395a7; }
.empty-state i{ font-size:60px; color:#dfe4ea; margin-bottom:14px; display:block; }

/* ---------- ویزارد چند مرحله‌ای ---------- */
.bm-steps{ display:flex; justify-content:space-between; margin-bottom:30px; gap:8px; }
.bm-step{ flex:1; text-align:center; position:relative; }
.bm-step .circle{
  width:42px; height:42px; border-radius:50%; background:#f1f2f6; color:#8395a7;
  display:flex; align-items:center; justify-content:center; margin:0 auto 8px; font-weight:800;
  transition:.25s;
}
.bm-step.active .circle{ background:linear-gradient(135deg,var(--bm-primary),#8579f0); color:#fff; box-shadow:0 6px 14px rgba(108,92,231,.35);}
.bm-step.done .circle{ background:var(--bm-success); color:#fff; }
.bm-step span.title{ font-size:13px; font-weight:700; color:#57606f; }
.wizard-pane{ display:none; }
.wizard-pane.active{ display:block; animation:fadeIn .3s; }
@keyframes fadeIn{ from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:none;} }

/* ---------- عمومی ---------- */
.bm-sidebar-mobile-toggle{ display:none; }
@media (max-width:991px){
  .bm-sidebar{ position:fixed; right:-280px; z-index:1050; transition:.3s; box-shadow:0 0 40px rgba(0,0,0,.2); }
  .bm-sidebar.open{ right:0; }
  .bm-sidebar-mobile-toggle{ display:inline-flex; }
  .bm-main{ padding:16px; }
  .bm-topbar{ padding:14px 16px; }
}

.progress-bm{ height:10px; border-radius:20px; background:#f1f2f6; overflow:hidden; }
.progress-bm .bar{ height:100%; border-radius:20px; background:linear-gradient(135deg,var(--bm-primary),var(--bm-secondary)); }

footer.bm-footer{ text-align:center; color:#b2bec3; font-size:13px; padding:20px; }

/* ---------- نوتیفیکیشن (زنگوله + لیست) ---------- */
.notif-bell-btn{ position:relative; }
.notif-badge{
  position:absolute; top:-4px; left:-4px;
  background:linear-gradient(135deg,#ff6b6b,#ff9a9a);
  color:#fff; font-size:10px; font-weight:800;
  min-width:18px; height:18px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  padding:0 4px; box-shadow:0 2px 6px rgba(255,107,107,.5);
}

.notif-dropdown{
  width:340px; max-width:90vw;
  border:none; border-radius:18px;
  box-shadow:0 20px 45px rgba(0,0,0,.14);
  overflow:hidden; padding:0;
}
.notif-dropdown-header{ background:#f8f8fd; border-bottom:1px solid #f1f2fb; }
.notif-list{ max-height:360px; overflow-y:auto; }

.notif-item{
  display:flex; align-items:flex-start; gap:10px;
  width:100%; text-align:right; background:none; border:none;
  padding:12px 14px; border-bottom:1px solid #f4f5fb;
  transition:.15s;
}
.notif-item:hover{ background:#f8f7ff; }

.notif-icon{
  flex-shrink:0; width:38px; height:38px; border-radius:12px;
  background:linear-gradient(135deg,var(--bm-primary),#8579f0);
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:16px;
}
.notif-text{ display:flex; flex-direction:column; gap:2px; min-width:0; flex:1; }
.notif-title{ font-weight:700; font-size:13.5px; color:#2d3436; }
.notif-body{ font-size:12.5px; color:#8395a7; white-space:normal; }
.notif-time{ font-size:11px; color:#b2bec3; margin-top:2px; }

.notif-see-all{
  display:block; text-align:center; padding:12px;
  font-size:13px; font-weight:700; color:var(--bm-primary);
  border-top:1px solid #f1f2fb; background:#fafaff;
}
.notif-see-all:hover{ background:#f4f2ff; }

/* ردیف‌های صفحه کامل اعلان‌ها */
.notif-row{
  display:flex; align-items:flex-start; gap:12px;
  width:100%; text-align:right; background:#fafbff; border:none;
  padding:16px; border-radius:14px; margin-bottom:10px; position:relative;
}
.notif-row-unread{ background:#f4f2ff; }
.notif-row .notif-title{ font-size:15px; }
.notif-row .notif-body{ font-size:13.5px; }
.notif-unread-dot{
  position:absolute; top:16px; left:16px;
  width:9px; height:9px; border-radius:50%;
  background:var(--bm-primary);
}

/* =========================================================
   جدول‌ها در موبایل: به‌جای اسکرول افقی، هر ردیف یک کارت می‌شود
   (کلاس bm-mobile-table و data-label توسط scripts.blade.php اضافه می‌شود)
   ========================================================= */
@media (max-width: 767.98px){
  .table-responsive{ overflow-x: visible; }

  table.bm-mobile-table,
  table.bm-mobile-table tbody{ display:block; width:100%; border-spacing:0; }
  table.bm-mobile-table thead{ display:none; }

  table.bm-mobile-table tbody tr{
    display:block;
    background:#fafbff;
    border:1px solid #eef0fb;
    border-radius:16px;
    padding:4px 14px;
    margin-bottom:12px;
  }
  table.bm-mobile-table tbody td{
    display:flex; align-items:center; justify-content:space-between; gap:14px;
    padding:10px 0 !important;
    border:0 !important; border-bottom:1px dashed #e8eaf6 !important;
    border-radius:0 !important;
    text-align:start !important;
    font-size:14.5px;
    min-width:0; overflow-wrap:anywhere;
  }
  table.bm-mobile-table tbody td[dir="ltr"]{ direction:rtl; }
  table.bm-mobile-table tbody td::before{
    content: attr(data-label);
    flex-shrink:0;
    color:#8395a7; font-size:12.5px; font-weight:700;
  }
  table.bm-mobile-table tbody td:first-child{ font-size:16px; }

  /* ردیف‌های بدون برچسب: دکمه‌های عملیات و پیام «موردی نیست» */
  table.bm-mobile-table tbody td.bm-cell-actions{
    justify-content:flex-start; flex-wrap:wrap; gap:8px;
    border-bottom:0 !important; padding:12px 0 8px !important;
  }
  table.bm-mobile-table tbody td.bm-cell-actions::before,
  table.bm-mobile-table tbody td.bm-cell-full::before{ content:none; }
  table.bm-mobile-table tbody td.bm-cell-full{ justify-content:center; text-align:center !important; border-bottom:0 !important; }
  table.bm-mobile-table tbody td:last-child{ border-bottom:0 !important; }

  table.bm-mobile-table .btn-sm{ min-width:42px; min-height:42px; display:inline-flex; align-items:center; justify-content:center; gap:4px; }

  /* هر محتوای عریض دیگر هم از صفحه بیرون نزند */
  .bm-main img, .bm-main video{ max-width:100%; height:auto; }
  .bm-main{ overflow-wrap:anywhere; }
}

/* ---------- بنر فعال‌سازی اعلان گوشی ---------- */
.bm-push-banner{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  background:linear-gradient(135deg,#f4f2ff,#eafffd);
  border:1px solid #e3defd; border-radius:16px;
  padding:12px 16px; margin-bottom:18px;
  font-size:14px; color:#2d3436;
}
.bm-push-banner > i{ color:var(--bm-primary); }
.bm-push-banner-btn{ width:auto !important; padding:8px 20px !important; font-size:14px !important; }
.bm-push-banner.d-none{ display:none !important; }
@media (max-width:575.98px){
  .bm-push-banner{ align-items:flex-start; }
  .bm-push-banner .flex-grow-1{ flex-basis:calc(100% - 80px); }
  .bm-push-banner-btn{ flex:1; }
}
