/* فونت Vazirmatn را از طریق <link rel="preconnect"> و <link rel="stylesheet"> در HTML بارگذاری کنید */

:root{
  --bg-dark:#050c1c;
  --bg-light:#0f1f3a;
  --bg-panel:rgba(12,24,52,0.88);
  --bg-panel-strong:rgba(16,32,68,0.95);
  --glass:#0f1f3add;
  --accent:#5ad6ff;
  --accent-soft:#9ad8ff;
  --accent-strong:#2ad0ff;
  --text:#f5f7ff;
  --text-strong:#f4f7ff;
  --text-normal:#cbd4ec;
  --text-muted:#8c9ac4;
  --muted:#a5b4ce;
  --border:rgba(255,255,255,0.08);
  --border-strong:rgba(255,255,255,0.2);
  --input-base:rgba(12,26,53,0.85);
  --input-hover:rgba(24,48,92,0.95);
  --shadow-strong:0 24px 80px rgba(0,0,0,0.55);
  --shadow-soft:0 12px 40px rgba(38,129,255,0.18);
  --success:#22d39b;
  --danger:#ff6f6f;
}

*{box-sizing:border-box;margin:0;padding:0;}
body{
  font-family:"Vazirmatn",sans-serif;
  direction:rtl;
  color:var(--text);
  background:var(--bg-dark);
  min-height:100vh;
}
a{text-decoration:none;color:inherit;}
ul{list-style:none}

/* پس‌زمینه گالری */
.gallery-bg{
  position:relative;
  background:
    radial-gradient(circle at 16% 22%,rgba(54,123,255,0.25),transparent 55%),
    radial-gradient(circle at 82% 8%,rgba(85,210,255,0.18),transparent 60%),
    var(--bg-dark);
  overflow-x:hidden;
}
.gallery-bg::after{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  background-image:url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='.028'%3E%3Ccircle cx='12' cy='18' r='2'/%3E%3Ccircle cx='150' cy='80' r='1.6'/%3E%3Ccircle cx='80' cy='140' r='1.8'/%3E%3Ccircle cx='190' cy='180' r='1.2'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events:none;
  opacity:0.65;
}

/* سربرگ */
.app-header{
  position:sticky;
  top:0;
  z-index:30;
  padding:22px 42px;
  background:linear-gradient(180deg,rgba(5,12,28,0.96),rgba(5,12,28,0));
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}
.header-wrap{display:flex;align-items:center;justify-content:space-between;gap:18px;}
.app-logo{display:flex;align-items:center;gap:14px;}
.logo-spark{font-size:1.7rem;filter:drop-shadow(0 0 14px rgba(90,214,255,0.65));}
.app-logo strong{display:block;font-weight:700;font-size:1.08rem;}
.app-logo small{display:block;font-size:0.82rem;color:var(--muted);}
.header-actions{display:flex;gap:12px;flex-wrap:wrap;}
.header-actions a{
  padding:9px 22px;
  border-radius:999px;
  background:rgba(255,255,255,0.08);
  border:1px solid var(--border);
  transition:0.22s;
}
.header-actions a:hover{
  background:rgba(255,255,255,0.18);
  color:var(--accent);
  box-shadow:0 8px 25px rgba(90,214,255,0.25);
}
.header-actions a.primary,
.settings-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 26px;
  border-radius:999px;
  background:linear-gradient(130deg,#5ad6ff,#8cefff);
  color:#041126;
  font-weight:700;
  box-shadow:0 18px 36px rgba(90,214,255,0.35);
  transition:transform 0.22s, box-shadow 0.22s;
}
.header-actions a.primary:hover,
.settings-link:hover{
  transform:translateY(-2px);
  box-shadow:0 24px 50px rgba(90,214,255,0.45);
}

/* لایه عمومی */
.layout{
  max-width:1180px;
  margin:0 auto;
  padding:42px 24px 70px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 280px;
  gap:26px;
}
.glass{
  background:var(--glass);
  border:1px solid var(--border);
  border-radius:22px;
  padding:28px;
  box-shadow:var(--shadow-strong);
}
.glass-sub{
  background:linear-gradient(160deg,rgba(11,28,58,0.92),rgba(5,13,30,0.78));
  border:1px solid rgba(90,214,255,0.18);
  border-radius:20px;
  padding:20px 22px;
  box-shadow:var(--shadow-soft);
}
.main-panel{display:flex;flex-direction:column;gap:26px;}
.panel-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:22px;}
.panel-heading h1{font-size:1.65rem;margin-bottom:6px;}
.panel-heading p{color:var(--muted);line-height:1.7;}
.count-chip{
  padding:10px 22px;
  border-radius:999px;
  background:linear-gradient(120deg,rgba(90,214,255,0.25),rgba(119,237,255,0.18));
  color:var(--accent);
  border:1px solid rgba(90,214,255,0.45);
  font-weight:700;
  box-shadow:0 10px 26px rgba(90,214,255,0.28);
}

/* فرم فیلتر عمومی */
.filters{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:18px 22px;
  align-items:end;
}
.filter-group{display:flex;flex-direction:column;gap:8px;position:relative;}
.filter-group label{
  font-size:0.85rem;
  color:var(--muted);
  letter-spacing:-0.01em;
}
.filter-group input,
.filter-group select{
  background:linear-gradient(135deg,var(--input-base),rgba(5,17,36,0.9));
  border:1px solid rgba(90,214,255,0.12);
  border-radius:14px;
  padding:11px 14px;
  color:var(--text);
  font-size:0.92rem;
  transition:border 0.2s,box-shadow 0.2s,transform 0.18s;
  box-shadow:inset 0 2px 6px rgba(0,0,0,0.28);
}
.filter-group input:hover,
.filter-group select:hover{
  border-color:rgba(90,214,255,0.35);
  background:linear-gradient(135deg,var(--input-hover),rgba(9,24,45,0.95));
}
.filter-group input:focus,
.filter-group select:focus{
  border-color:rgba(90,214,255,0.6);
  box-shadow:0 0 0 3px rgba(90,214,255,0.18);
  outline:none;
  transform:translateY(-1px);
}
.filter-group input::placeholder{color:rgba(165,180,206,0.75);}

/* کنترل واحد برای همه‌ی سلکت‌ها */
.filter-group select,
.filters-form select,
.apply-field select,
.form-grid select,
form.filters .filter-item select{
  appearance:none;
  -webkit-appearance:none;
  padding:11px 14px;
  padding-left:44px;
  background-image:url("data:image/svg+xml,%3Csvg fill='%239ad8ff' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.41 8.58 12 13.17l4.59-4.59L18 10l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-size:18px;
  background-position:left 14px center;
  color:var(--text);
}
.filter-group select option,
.filters-form select option,
.apply-field select option,
.form-grid select option,
form.filters .filter-item select option{
  background:#061229;
  color:#e5efff;
}
.filter-group select option:hover,
.filters-form select option:hover,
.apply-field select option:hover,
.form-grid select option:hover,
form.filters .filter-item select option:hover{
  background:#0c234b;
  color:#9fe6ff;
}

.filter-actions{
  display:flex;
  align-items:center;
  gap:14px;
  justify-content:flex-start;
}
.filter-actions button{
  background:linear-gradient(120deg,#5ad6ff,#8cefff);
  color:#041126;
  border:none;
  border-radius:14px;
  padding:12px 22px;
  font-weight:700;
  cursor:pointer;
  transition:transform 0.22s,box-shadow 0.22s;
}
.filter-actions button:hover{
  transform:translateY(-2px);
  box-shadow:0 16px 34px rgba(90,214,255,0.38);
}
.filter-actions .reset{
  padding:12px 22px;
  border-radius:14px;
  border:1px dashed rgba(90,214,255,0.42);
  background:rgba(5,17,36,0.55);
  color:var(--accent-soft);
  transition:0.22s;
}
.filter-actions .reset:hover{
  border-style:solid;
  border-color:rgba(90,214,255,0.8);
  color:var(--accent);
  box-shadow:0 12px 30px rgba(90,214,255,0.2);
}

/* گالری */
.gallery-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:22px;
}
.card{
  background:#08152b;
  border:1px solid rgba(255,255,255,0.05);
  border-radius:20px;
  overflow:hidden;
  box-shadow:0 16px 44px rgba(0,0,0,0.45);
  display:flex;
  flex-direction:column;
  transition:transform 0.2s,box-shadow 0.2s;
}
.card:hover{
  transform:translateY(-4px);
  box-shadow:0 20px 55px rgba(90,214,255,0.22);
}
.card-header{display:flex;flex-direction:column;gap:6px;padding:16px 18px 0;}
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:max-content;
  padding:4px 13px;
  border-radius:999px;
  background:rgba(90,214,255,0.15);
  color:var(--accent);
  font-size:0.8rem;
  letter-spacing:-0.01em;
}
.filename{
  font-weight:600;
  color:#fff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.thumb{
  display:block;
  position:relative;
  margin:14px 18px;
  border-radius:16px;
  overflow:hidden;
}
.thumb::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(180deg,rgba(0,0,0,0),rgba(0,0,0,0.35));
  opacity:0;
  transition:opacity 0.3s;
}
.thumb img{
  width:100%;
  height:220px;
  object-fit:cover;
  display:block;
  transition:transform 0.35s;
}
.thumb:hover img{transform:scale(1.05);}
.thumb:hover::after{opacity:1;}
.card-footer{
  padding:14px 20px 20px;
  font-size:0.86rem;
  color:var(--muted);
  border-top:1px solid rgba(255,255,255,0.05);
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:8px;
}
.card-footer span{display:block;}

/* سایدبار */
.sidebar{display:flex;flex-direction:column;gap:20px;}
.sidebar h3{font-size:1.12rem;}
.cat-list li{margin-bottom:10px;}
.cat-list a{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:11px 16px;
  border-radius:14px;
  background:rgba(255,255,255,0.05);
  border:1px solid transparent;
  transition:0.22s;
}
.cat-list li.active a{
  border-color:var(--accent);
  box-shadow:0 0 18px rgba(90,214,255,0.32);
  background:rgba(255,255,255,0.14);
}
.cat-list a:hover{
  transform:translateY(-2px);
  background:rgba(255,255,255,0.1);
}
.cat-list span:last-child{
  font-weight:700;
  color:var(--accent);
}
.hint{
  font-size:0.86rem;
  line-height:1.9;
  color:var(--muted);
}

/* پیغام خالی */
.empty{
  color:var(--muted);
  text-align:center;
  padding:38px;
  border:1px dashed rgba(255,255,255,0.22);
  border-radius:18px;
  background:rgba(8,21,43,0.6);
}

/* لایت‌باکس */
#lightbox{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.7);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  pointer-events:none;
  transition:opacity 0.3s;
  z-index:999;
}
#lightbox.active{opacity:1;pointer-events:auto;}
.lightbox-inner{width:min(90vw,900px);max-height:90vh;}
.lightbox-frame{
  background:#0b1a33;
  border-radius:22px;
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:16px;
  box-shadow:0 28px 80px rgba(0,0,0,0.55);
}
.lightbox-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  color:#fff;
}
.lightbox-close{
  background:rgba(255,255,255,0.12);
  border:none;
  color:#fff;
  font-size:1.4rem;
  width:42px;
  height:42px;
  border-radius:14px;
  cursor:pointer;
  transition:0.2s;
}
.lightbox-close:hover{
  background:rgba(255,255,255,0.25);
  box-shadow:0 10px 28px rgba(90,214,255,0.35);
}
.lightbox-body img{
  width:100%;
  max-height:70vh;
  object-fit:contain;
  border-radius:14px;
}
.lightbox-footer{
  color:var(--muted);
  font-size:0.84rem;
}

/* لاگین */
body.login-bg{
  font-family:"Vazirmatn",sans-serif;
  direction:rtl;
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:center;
  background:
    radial-gradient(circle at 15% 20%,rgba(16,45,92,0.7),transparent 45%),
    radial-gradient(circle at 80% 0,rgba(28,60,104,0.55),transparent 50%),
    var(--bg-dark);
  position:relative;
  overflow:hidden;
}
body.login-bg::after{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  background-image:url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='.028'%3E%3Ccircle cx='12' cy='18' r='2'/%3E%3Ccircle cx='150' cy='80' r='1.6'/%3E%3Ccircle cx='80' cy='140' r='1.8'/%3E%3Ccircle cx='190' cy='180' r='1.2'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events:none;
  opacity:0.7;
}
.login-container{
  width:min(360px,90vw);
  padding:40px 36px;
  border-radius:24px;
  background:linear-gradient(160deg,rgba(13,33,61,0.9),rgba(5,14,30,0.82));
  border:1px solid rgba(255,255,255,0.12);
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  box-shadow:0 36px 90px rgba(0,0,0,0.55);
  text-align:center;
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  gap:18px;
}
.login-logo{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  color:var(--text);
}
.login-logo img{
  width:74px;
  height:74px;
  object-fit:contain;
  filter:drop-shadow(0 16px 40px rgba(90,214,255,0.4));
}
.login-logo h1{font-size:1.24rem;font-weight:700;}
.login-container h2{
  color:var(--text);
  margin-bottom:2px;
  font-size:1.02rem;
  opacity:0.92;
}
.login-form{
  display:flex;
  flex-direction:column;
  gap:16px;
  margin-top:6px;
}
.login-form input{
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.18);
  background:rgba(9,22,42,0.9);
  color:var(--text);
  font-size:0.95rem;
  transition:border 0.22s,box-shadow 0.22s;
  box-shadow:inset 0 1px 6px rgba(0,0,0,0.25);
}
.login-form input:focus{
  border-color:rgba(90,214,255,0.6);
  box-shadow:0 0 0 3px rgba(90,214,255,0.22);
  outline:none;
}
.login-form button{
  padding:13px;
  border:none;
  border-radius:16px;
  font-size:1.02rem;
  font-weight:600;
  color:#041126;
  background:linear-gradient(125deg,#5ad6ff,#8cefff);
  cursor:pointer;
  transition:transform 0.22s,box-shadow 0.22s;
}
.login-form button:hover{
  transform:translateY(-2px);
  box-shadow:0 18px 36px rgba(90,214,255,0.38);
}
.error{
  color:#ff9c9c;
  font-size:0.9rem;
  background:rgba(255,0,0,0.13);
  border:1px solid rgba(255,0,0,0.25);
  border-radius:12px;
  padding:9px 12px;
}
.login-hint{
  font-size:0.86rem;
  color:var(--muted);
  margin-top:10px;
}

/* ریسپانسیو عمومی */
@media (max-width:1100px){
  .layout{grid-template-columns:1fr;}
  .sidebar{order:-1;}
}
@media (max-width:768px){
  .panel-heading{flex-direction:column;align-items:flex-start;}
  .filters{grid-template-columns:repeat(auto-fit,minmax(170px,1fr));}
  .filter-actions{grid-column:1 / -1;justify-content:flex-end;}
}
@media (max-width:600px){
  .layout{padding:32px 18px 60px;}
  .filters{grid-template-columns:1fr;}
  .filter-actions{flex-direction:column;align-items:stretch;}
  .filter-actions button,
  .filter-actions .reset{width:100%;text-align:center;}
  .gallery-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));}
  .thumb img{height:180px;}
}

/* Persian datepicker */
.pwt-datepicker,
.pwt-date-container,
.persian-datepicker,
.persianDatepicker {
  font-family:"Vazirmatn",sans-serif !important;
  background:linear-gradient(160deg,#0b1a33,#050c1c) !important;
  border:1px solid rgba(90,214,255,0.25) !important;
  border-radius:18px !important;
  box-shadow:0 30px 80px rgba(0,0,0,0.55) !important;
  color:var(--text) !important;
  overflow:hidden;
}
.pwt-datepicker .pwt-header,
.persian-datepicker .header {
  background:rgba(255,255,255,0.06) !important;
  color:#e8f7ff !important;
  border-bottom:1px solid rgba(90,214,255,0.25) !important;
}
.pwt-date-info,
.pwt-date-info *,
.persian-datepicker .header span{
  color:#e8f7ff !important;
  font-weight:600 !important;
  text-shadow:0 0 12px rgba(90,214,255,0.45) !important;
}
.pwt-btn-next,
.pwt-btn-prev,
.persian-datepicker .next,
.persian-datepicker .prev{
  color:#9fdfff !important;
  opacity:0.9 !important;
  transition:color 0.2s ease, transform 0.2s ease;
}
.pwt-btn-next:hover,
.pwt-btn-prev:hover,
.persian-datepicker .next:hover,
.persian-datepicker .prev:hover{
  color:#5ad6ff !important;
  transform:scale(1.1);
}
.pwt-datepicker table td,
.persian-datepicker table td{
  color:var(--text) !important;
  transition:0.15s;
}
.pwt-datepicker table td span,
.persian-datepicker table td span{
  border-radius:12px !important;
}
.pwt-datepicker table td span:hover,
.persian-datepicker table td span:hover{
  background:rgba(90,214,255,0.18) !important;
  color:#fff !important;
}
.pwt-datepicker table td.selected span,
.persian-datepicker table td.selected span,
.pwt-datepicker table td.today span,
.persian-datepicker table td.today span{
  background:linear-gradient(130deg,#5ad6ff,#8cefff) !important;
  color:#041126 !important;
  box-shadow:0 12px 30px rgba(90,214,255,0.35) !important;
}
.pwt-footer,
.persian-datepicker .footer{
  background:rgba(255,255,255,0.04) !important;
  border-top:1px solid rgba(255,255,255,0.08) !important;
  color:var(--muted) !important;
  display:flex !important;
  justify-content:center !important;
  padding:10px 16px !important;
}
.pwt-btn-today,
.persian-datepicker .today-btn{
  display:inline-flex !هم;
  align-items:center !important;
  justify-content:center !important;
  min-width:120px !important;
  background:linear-gradient(130deg,#5ad6ff,#8cefff) !important;
  color:#041126 !important;
  border:none !important;
  border-radius:12px !important;
  padding:9px 18px !important;
  font-weight:600 !important;
  box-shadow:0 14px 28px rgba(90,214,255,0.3) !important;
  margin:0 auto !important;
}

/* ---------- صفحه تنظیمات دوربین ---------- */
body.settings-bg{
  background:
    radial-gradient(circle at 18% 22%,rgba(96,165,255,0.2),transparent 55%),
    radial-gradient(circle at 80% 0%,rgba(73,211,255,0.14),transparent 45%),
    #020714;
  min-height:100vh;
}
.settings-layout{
  max-width:1180px;
  margin:0 auto;
  padding:42px 24px 80px;
  display:flex;
  flex-direction:column;
  gap:28px;
}
.settings-head h1{
  font-size:1.8rem;
  margin-bottom:6px;
}
.settings-head p{color:var(--muted);}

/* پانل فیلتر تنظیمات */
.filters-panel{
  background:var(--glass);
  border:1px solid var(--border);
  border-radius:26px;
  padding:24px 28px;
  box-shadow:var(--shadow-strong);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}
.filters-form{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:18px;
  align-items:end;
}
.filters-form label{
  display:flex;
  flex-direction:column;
  gap:8px;
  font-size:0.88rem;
  color:var(--muted);
}
.filters-form input,
.filters-form select{
  border-radius:16px;
  background:linear-gradient(135deg,var(--input-base),rgba(5,17,36,0.9));
  border:1px solid rgba(90,214,255,0.18);
  padding:10px 14px;
  color:#fff;
}
.sort-group{
  display:flex;
  gap:10px;
}
.filters-form .primary{
  background:linear-gradient(120deg,#5ad6ff,#8cefff);
  color:#041126;
  border:none;
  border-radius:16px;
  padding:11px 20px;
  font-weight:700;
  cursor:pointer;
}
.filters-form .ghost{
  border:1px dashed rgba(90,214,255,0.4);
  border-radius:16px;
  padding:11px 20px;
  color:var(--accent);
  text-align:center;
}

/* پیام‌ها */
.msg{
  padding:14px 18px;
  border-radius:16px;
  font-weight:600;
  border:1px solid transparent;
}
.msg.success{background:rgba(46,204,113,0.15);border-color:rgba(46,204,113,0.45);color:#9ff3c3;}
.msg.error{background:rgba(231,76,60,0.18);border-color:rgba(231,76,60,0.42);color:#ffb3a8;}
.camera-empty{
  border:1px dashed rgba(255,255,255,0.25);
  border-radius:18px;
  padding:30px;
  text-align:center;
  color:var(--muted);
}

/* نسخه جدید داشبورد مدیریت تنظیمات */
.settings-page{
  padding:32px;
  display:flex;
  flex-direction:column;
  gap:20px;
}
.settings-page .panel-heading{
  border-bottom:1px solid var(--border);
  padding-bottom:12px;
}
.settings-page .panel-heading h1{
  margin:0;
  color:var(--text-strong);
  font-size:1.4rem;
}
.settings-page .panel-heading small{
  color:var(--text-muted);
}

/* پیام‌های فلش */
.flash{
  border-radius:14px;
  padding:14px 18px;
  font-size:0.9rem;
  border:1px solid transparent;
  background:var(--bg-panel);
}
.flash.success{
  border-color:rgba(34,211,155,0.4);
  background:rgba(34,211,155,0.12);
  color:var(--success);
}
.flash.error{
  border-color:rgba(255,111,111,0.4);
  background:rgba(255,111,111,0.12);
  color:var(--danger);
}

/* فرم فیلتر داخل صفحه تنظیمات */
form.filters{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:18px;
  padding:24px;
  border-radius:24px;
  background:var(--bg-panel);
  border:1px solid var(--border);
  box-shadow:0 24px 50px rgba(2,6,14,0.6);
}
.filters .filter-item label{
  font-size:0.85rem;
  color:var(--text-muted);
}
.filters .filter-item input,
.filters .filter-item select{
  margin-top:8px;
  width:100%;
  padding:10px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:var(--glass);
  color:var(--text-strong);
  transition:border 0.2s, background 0.2s;
}
.filters .filter-item input:focus,
.filters .filter-item select:focus{
  outline:none;
  border-color:var(--accent);
  background:rgba(122,225,255,0.08);
}
.filters .filter-item button.save-inline{
  width:100%;
  margin-top:0;
}
.filters .filter-item .apply-actions{
  display:flex;
  gap:12px;
}

/* دکمه‌های عمومی */
.btn-primary,
.btn-ghost{
  border-radius:14px;
  padding:11px 18px;
  font-weight:600;
  border:1px solid transparent;
  cursor:pointer;
  transition:transform 0.15s ease, box-shadow 0.2s;
}
.btn-primary{
  background:linear-gradient(120deg,var(--accent),var(--accent-strong));
  color:#031126;
  box-shadow:0 14px 30px rgba(63,195,255,0.35);
}
.btn-primary:hover{transform:translateY(-1px);}
.btn-ghost{
  border-color:var(--border-strong);
  background:transparent;
  color:var(--text-normal);
}
.btn-ghost:hover{
  border-color:var(--accent);
  color:var(--accent);
}

/* پنل اعمال گروهی */
.apply-board{
  padding:24px;
  border-radius:24px;
  background:var(--bg-panel-strong);
  border:1px solid var(--border);
  box-shadow:0 28px 55px rgba(2,6,14,0.65);
  display:flex;
  flex-direction:column;
  gap:20px;
}
.apply-row{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:18px;
}
.apply-field{
  background:var(--glass);
  border:1px solid transparent;
  border-radius:18px;
  padding:14px;
  display:grid;
  grid-template-columns:auto 1fr;
  gap:12px;
  align-items:center;
  transition:border 0.2s;
}
.apply-field.active{border-color:var(--accent);}
.apply-field input[type="checkbox"]{
  accent-color:var(--accent);
  width:18px;
  height:18px;
}
.apply-field label{
  display:block;
  font-size:0.78rem;
  color:var(--text-muted);
  margin-bottom:6px;
}
.apply-field input[type="number"],
.apply-field select{
  width:100%;
  padding:9px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.05);
  color:var(--text-strong);
}
.apply-actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
}
.select-all{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:0.9rem;
}
.select-all input{
  width:18px;
  height:18px;
  accent-color:var(--accent);
}

/* کارت‌ها */
.cam-list{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  gap:18px;
}
.cam-card{
  padding:22px;
  border-radius:26px;
  border:1px solid var(--border);
  background:var(--bg-panel);
  box-shadow:0 24px 55px rgba(2,6,14,0.55);
  display:flex;
  flex-direction:column;
  gap:18px;
  transition:border 0.2s, transform 0.2s, box-shadow 0.2s;
}
.cam-card:hover{
  border-color:var(--accent);
  transform:translateY(-4px);
  box-shadow:0 32px 68px rgba(7,15,32,0.65);
}
.cam-card.checked{
  border-color:var(--accent-strong);
  background:rgba(36,75,160,0.18);
}

.card-select{
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.card-select label{
  display:flex;
  gap:8px;
  align-items:center;
  font-size:0.85rem;
  color:var(--text-muted);
}
.card-select input[type="checkbox"]{
  width:16px;
  height:16px;
  accent-color:var(--accent);
}
.status-pill{
  padding:6px 16px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:0.78rem;
}
.status-pill.on{
  border-color:rgba(34,211,155,0.5);
  background:rgba(34,211,155,0.12);
  color:var(--success);
}
.status-pill.off{
  border-color:rgba(255,111,111,0.5);
  background:rgba(255,111,111,0.12);
  color:var(--danger);
}

.card-heading{
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.cam-name{
  font-size:1.1rem;
  color:var(--text-strong);
  font-weight:700;
}
.cam-id{
  font-size:0.82rem;
  color:var(--text-muted);
}
.card-dates{
  text-align:left;
  direction:ltr;
  font-size:0.78rem;
  color:var(--text-muted);
}

.cam-inline-form{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.form-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:16px;
}
.form-grid label{
  font-size:0.82rem;
  color:var(--text-muted);
  display:flex;
  flex-direction:column;
  gap:6px;
}
.form-grid input,
.form-grid select{
  border-radius:14px;
  border:1px solid var(--border);
  background:var(--glass);
  padding:10px 12px;
  color:var(--text-strong);
}
.form-grid input[type="checkbox"]{
  width:20px;
  height:20px;
  accent-color:var(--accent);
}

.form-actions{
  display:flex;
  justify-content:flex-end;
}
.save-inline{
  border:none;
  border-radius:16px;
  padding:11px 20px;
  background:linear-gradient(130deg,#5ad6ff,#90ffe0);
  color:#041021;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 16px 34px rgba(76,209,255,0.35);
  transition:transform 0.15s ease;
}
.save-inline:hover{transform:translateY(-2px);}

/* ساختارهای پیشین (حفظ برای صفحات دیگر) */
.settings-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(320px,1fr));
  gap:26px;
}
.camera-panel{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:18px;
  padding:26px;
  border-radius:24px;
  background:linear-gradient(165deg,#0b142c,#050c1f);
  border:1px solid var(--border);
  box-shadow:0 30px 70px rgba(0,0,0,0.45);
  transition:transform .25s ease, box-shadow .25s ease, border-color .25s;
}
.camera-panel:hover{
  transform:translateY(-4px);
  box-shadow:0 35px 90px rgba(0,0,0,0.55);
}
.camera-panel.selected{
  border-color:var(--accent);
  box-shadow:0 35px 95px rgba(112,242,209,0.2);
}
.camera-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.camera-header h2{
  margin:0;
  font-size:1.15rem;
}
.camera-header small{color:var(--muted);}
.status-dot{
  width:12px;
  height:12px;
  border-radius:50%;
  box-shadow:0 0 14px currentColor;
}
.status-dot.on{color:#5bffba;}
.status-dot.off{color:#ff7d7d;}
.select-chip{
  display:flex;
  align-items:center;
  justify-content:center;
}
.select-chip input{display:none;}
.select-chip span{
  width:20px;
  height:20px;
  border-radius:6px;
  border:2px solid rgba(255,255,255,0.35);
  position:relative;
  cursor:pointer;
  transition:border .2s, background .2s;
}
.select-chip input:checked + span{border-color:var(--accent);}
.select-chip input:checked + span::after{
  content:"";
  position:absolute;
  inset:4px;
  border-radius:4px;
  background:var(--accent);
}

.camera-meta{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  font-size:.85rem;
}
.camera-meta dt{
  color:var(--muted);
  margin-bottom:4px;
  font-weight:600;
}
.camera-meta dd{
  margin:0;
  font-weight:700;
  color:#fff;
}

.camera-form{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}
.camera-form label{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:.88rem;
  color:var(--muted);
}
.camera-form input,
.camera-form select{
  border-radius:16px;
  border:1px solid rgba(255,255,255,0.1);
  background:rgba(3,9,24,0.85);
  padding:10px 12px;
  color:#fdfdfd;
}
.camera-actions{
  grid-column:span 2;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.toggle{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:600;
  color:#fff;
}
.toggle input{
  width:36px;
  height:18px;
  accent-color:var(--accent);
}
.camera-form .save-btn{
  padding:10px 18px;
  border-radius:16px;
  border:none;
  background:linear-gradient(130deg,#5ad6ff,#8cefff);
  color:#041126;
  font-weight:700;
  cursor:pointer;
  transition:transform 0.22s, box-shadow 0.22s;
  box-shadow:0 18px 36px rgba(90,214,255,0.35);
}
.camera-form .save-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 24px 48px rgba(90,214,255,0.45);
}
.save-state{
  grid-column:span 2;
  min-height:1.2em;
  font-size:.8rem;
  color:var(--muted);
}
.save-state.success{color:#8cfdd5;}
.save-state.error{color:#ff9696;}

/* Bulk actions bar */
.bulk-bar{
  position:fixed;
  bottom:-180px;
  left:50%;
  transform:translateX(-50%);
  width:min(1100px,92vw);
  background:rgba(5,14,31,0.95);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:28px 28px 12px 12px;
  padding:20px 26px;
  box-shadow:0 25px 80px rgba(0,0,0,0.55);
  display:flex;
  align-items:center;
  gap:24px;
  transition:bottom .35s ease;
  z-index:50;
}
.bulk-bar.visible{bottom:24px;}
.bulk-info{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.bulk-info strong{
  font-size:1.6rem;
  font-weight:800;
}
.bulk-controls{
  flex:1;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:12px;
}
.bulk-controls label{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:.8rem;
  color:var(--muted);
}
.bulk-controls input,
.bulk-controls select{
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.15);
  background:rgba(7,16,35,0.95);
  color:#fff;
  padding:8px 10px;
}
.ghost-toggle{
  flex-direction:row;
  align-items:center;
  justify-content:flex-start;
}
.bulk-actions{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.bulk-actions .ghost,
.bulk-actions .primary{
  border-radius:999px;
  padding:9px 18px;
  font-weight:600;
  cursor:pointer;
}
.bulk-actions .ghost{
  border:1px solid rgba(255,255,255,0.35);
  background:transparent;
  color:#fff;
}
.bulk-actions .ghost:hover{
  border-color:var(--accent);
  color:var(--accent);
}
.bulk-actions .primary{
  border:none;
  background:linear-gradient(135deg,#5ad6ff,#8cefff);
  color:#041126;
  box-shadow:0 18px 36px rgba(90,214,255,0.35);
}
.bulk-state{
  width:100%;
  font-size:.8rem;
  color:var(--muted);
  margin-top:6px;
}
.bulk-state.success{color:#7fffc9;}
.bulk-state.error{color:#ff8f8f;}
.bulk-state.warning{color:#ffd479;}

/* کارت‌های انتخاب چندتایی در Bulk grid */
.bulk-grid .cam-card{
  position:relative;
  padding:18px 24px 18px 62px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,0.14);
  background:rgba(255,255,255,0.05);
  transition:0.2s;
  cursor:pointer;
}
.bulk-grid .cam-card:hover{transform:translateY(-2px);}
.bulk-grid .cam-card.checked{
  border-color:var(--accent);
  box-shadow:0 18px 32px rgba(90,214,255,0.25);
}
.bulk-grid .cam-card input[type="checkbox"]{
  position:absolute;
  left:18px;
  top:18px;
  width:22px;
  height:22px;
  accent-color:var(--accent);
}
.cam-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
}
.cam-name{font-weight:600;font-size:1rem;}
.cam-id{color:var(--muted);font-size:0.82rem;}
.status-chip{
  padding:6px 12px;
  border-radius:999px;
  font-size:0.78rem;
  border:1px solid rgba(255,255,255,0.3);
}
.status-chip.on{color:#2ecc71;border-color:rgba(46,204,113,0.6);background:rgba(46,204,113,0.12);}
.status-chip.off{color:#e74c3c;border-color:rgba(231,76,60,0.5);background:rgba(231,76,60,0.12);}
.cam-meta{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px 12px;
  margin:14px 0 8px;
  font-size:0.86rem;
}
.cam-meta span{display:block;color:var(--muted);font-size:0.78rem;margin-bottom:4px;}
.cam-footer small{color:var(--muted);font-size:0.78rem;}

/* فضاهای کمکی */
.settings-empty{
  border:1px dashed rgba(255,255,255,0.25);
  border-radius:16px;
  padding:24px;
  text-align:center;
  color:var(--muted);
}
.apply-board .note{color:var(--muted);font-size:0.82rem;}
.apply-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:18px;
}
.apply-item{
  border:1px dashed rgba(255,255,255,0.18);
  border-radius:16px;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.apply-toggle{display:flex;align-items:center;gap:8px;font-weight:600;}
.apply-toggle input{accent-color:var(--accent);}
.apply-control{
  background:rgba(255,255,255,0.05);
  border-radius:12px;
  padding:12px;
}
.apply-control.disabled{opacity:0.5;filter:grayscale(0.5);}
.apply-control input,
.apply-control select{
  width:100%;
  border:none;
  background:transparent;
  color:var(--text);
  font-size:0.95rem;
}
.apply-control input:disabled,
.apply-control select:disabled{color:rgba(255,255,255,0.6);}
.radio-group{display:flex;gap:14px;flex-wrap:wrap;}
.radio-group label{display:flex;gap:6px;align-items:center;font-size:0.9rem;}
.radio-group input{accent-color:var(--accent);}
.apply-actions .primary-btn,
.primary-btn{
  border:none;
  border-radius:16px;
  padding:12px 26px;
  font-weight:700;
  background:linear-gradient(120deg,#5ad6ff,#8cefff);
  color:#041126;
  cursor:pointer;
  transition:0.2s;
}
.primary-btn:disabled{opacity:0.4;cursor:not-allowed;}
.apply-actions .primary-btn:hover,
.primary-btn:hover{transform:translateY(-2px);}

/* کمک برای شمارنده انتخاب */
#selected_count{
  padding:6px 14px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.04);
  color:var(--text-muted);
  font-size:0.85rem;
}
