/* ================= کمپین کلندر — استایل ================= */
:root {
  --ink: #141B2E;
  --muted: #6B7488;
  --faint: #9AA2B4;
  --bg: #EDF0F6;
  --surface: #fff;
  --line: #D5DAE5;
  --primary: #2743B8;
  --green: #0FA47A;
  --danger: #D24B6A;
  --danger-soft: #F9E2E8;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 25, 46, .08);
}
* { box-sizing: border-box; font-family: Vazirmatn, Tahoma, sans-serif; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button { cursor: pointer; border: none; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; width: 100%; border: 1.5px solid var(--line); border-radius: 11px; padding: 10px 12px; font-size: 14px; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(39, 67, 184, .12); }
.hidden { display: none !important; }

/* ---------- هدر ---------- */
.hero { background: linear-gradient(135deg, #101A38 0%, #1C2B5E 55%, #2743B8 130%); color: #fff; padding: 26px clamp(14px, 4vw, 44px) 20px; border-radius: 0 0 26px 26px; box-shadow: 0 10px 30px rgba(16, 26, 56, .25); }
.hero-inner { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 14px; }
.brand { font-size: 25px; font-weight: 800; display: flex; align-items: center; gap: 10px; letter-spacing: -.5px; }
.brand-mark { color: #8FA4FF; font-size: 28px; }
.subtitle { color: rgba(255, 255, 255, .65); font-size: 12.5px; margin-top: 4px; }
.hero-left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; background: rgba(255, 255, 255, .12); border-radius: 12px; padding: 4px; }
.tab { background: transparent; padding: 8px 18px; border-radius: 9px; font-size: 13.5px; font-weight: 700; color: rgba(255, 255, 255, .75); transition: all .15s; }
.tab.active { background: #fff; color: var(--ink); }
.btn-add { background: var(--green); color: #fff; padding: 10px 20px; border-radius: 12px; font-size: 13.5px; font-weight: 800; box-shadow: 0 4px 14px rgba(15, 164, 122, .4); transition: transform .15s; }
.btn-add:hover { transform: translateY(-2px); }
.btn-add:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-ghost { background: rgba(255, 255, 255, .12); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 700; border: 1px solid rgba(255, 255, 255, .25); }
.month-bar { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 20px; }
.nav-btn { background: rgba(255, 255, 255, .14); color: #fff; width: 38px; height: 38px; border-radius: 11px; font-size: 20px; transition: background .15s; }
.nav-btn:hover { background: rgba(255, 255, 255, .24); }
.month-center { text-align: center; }
.month-title { font-size: 23px; font-weight: 800; }
.month-range { font-size: 11.5px; color: rgba(255, 255, 255, .6); margin-top: 3px; }

/* ---------- بدنه ---------- */
.main { padding: 20px clamp(14px, 4vw, 44px); }
.filter-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.dep-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 700; color: #4A5468; transition: all .15s; }
.pill:hover { transform: translateY(-1px); }
.select { width: auto; padding: 8px 12px; font-size: 13px; }
.loading { text-align: center; padding: 70px; color: var(--muted); font-size: 15px; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; font-size: 11.5px; color: var(--muted); }
.legend-item { display: flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.overlap-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; background: repeating-linear-gradient(45deg, var(--danger), var(--danger) 2px, #fff 2px, #fff 4px); border: 1px solid var(--danger); }

/* ---------- شبکه تقویم ---------- */
.grid7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-bottom: 30px; }
.week-head { text-align: center; font-size: 12px; font-weight: 800; padding: 6px 0; color: var(--muted); }
.week-head.friday { color: #C24343; }
.cell { min-height: 102px; border-radius: var(--radius); background: #fff; padding: 7px; box-shadow: var(--shadow); position: relative; border: 1.5px solid transparent; transition: transform .15s, box-shadow .15s; }
.cell.clickable { cursor: pointer; }
.cell:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(16, 25, 46, .12); }
.cell:hover .add-hint { opacity: 1; }
.cell.today { border-color: var(--primary); box-shadow: 0 6px 16px rgba(39, 67, 184, .18); }
.cell.overlap { border-color: #EBB7C4; background: #FFFBFC; }
.cell-top { display: flex; align-items: center; gap: 4px; margin-bottom: 5px; }
.day-num { font-size: 13px; font-weight: 800; width: 25px; height: 25px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.day-num.friday { color: #C24343; }
.day-num.today { background: var(--primary); color: #fff !important; }
.overlap-badge { font-size: 9.5px; font-weight: 800; color: var(--danger); background: var(--danger-soft); border-radius: 6px; padding: 1px 5px; }
.add-hint { margin-right: auto; opacity: 0; color: var(--faint); font-weight: 800; transition: opacity .15s; }
.chip-col { display: flex; flex-direction: column; gap: 3px; }
.chip { font-size: 10.5px; font-weight: 700; padding: 3px 6px; border-radius: 7px; display: flex; align-items: center; gap: 4px; cursor: pointer; transition: filter .15s; overflow: hidden; }
.chip:hover { filter: brightness(.93); }
.chip-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dep-mini { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.more-chip { font-size: 10px; color: var(--muted); padding-right: 4px; font-weight: 700; }

/* ---------- لیست و کارت‌ها ---------- */
.section { margin-bottom: 30px; }
.h2 { font-size: 17px; font-weight: 800; margin: 0 0 12px; }
.count { font-size: 11.5px; font-weight: 700; color: var(--muted); background: #fff; border-radius: 8px; padding: 3px 10px; margin-right: 8px; box-shadow: var(--shadow); }
.empty { background: #fff; border-radius: var(--radius); padding: 24px; color: var(--muted); font-size: 14px; text-align: center; box-shadow: var(--shadow); }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card { background: #fff; border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16, 25, 46, .13); }
.card-title { font-weight: 800; font-size: 14px; margin-bottom: 9px; }
.card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.badge { font-size: 11px; font-weight: 800; border-radius: 8px; padding: 3px 9px; }
.badge-gray { font-size: 11px; font-weight: 700; border-radius: 8px; padding: 3px 9px; background: var(--bg); color: #4A5468; }
.card-dates { font-size: 12px; color: var(--muted); }

/* ---------- داشبورد ---------- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-card { background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; transition: transform .15s; }
.stat-card:hover { transform: translateY(-2px); }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 3px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.panel { background: #fff; border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.panel.wide { grid-column: 1 / -1; }
.h3 { font-size: 14.5px; font-weight: 800; margin: 0 0 14px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.bar-label { width: 116px; font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
.bar-track { flex: 1; height: 10px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width .5s cubic-bezier(.2, .8, .3, 1); }
.bar-val { width: 26px; font-size: 12.5px; font-weight: 800; text-align: left; }
.overlap-row { padding: 12px 0; border-bottom: 1px solid var(--bg); }
.overlap-pair { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.overlap-dates { font-size: 12px; color: var(--faint); margin-top: 6px; }
.upcoming-row { display: flex; align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--bg); font-size: 13.5px; flex-wrap: wrap; }
.ok-box { color: var(--green); background: #E2F5EE; padding: 14px; border-radius: 12px; font-size: 13px; font-weight: 700; }
.empty-small { color: var(--muted); font-size: 13px; }

/* ---------- مودال ---------- */
.overlay { position: fixed; inset: 0; background: rgba(12, 18, 36, .55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 20px; padding: 24px; width: 100%; max-width: 490px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 70px rgba(12, 18, 36, .35); animation: modalIn .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.modal-sub { font-size: 12px; color: var(--faint); margin-bottom: 12px; }
.label { display: block; font-size: 12.5px; font-weight: 800; color: #4A5468; margin: 14px 0 6px; }
.row2 { display: flex; gap: 10px; }
.row2 > div { flex: 1; }
.date-row { display: flex; gap: 6px; }
.link-btn { background: transparent; color: var(--primary); font-size: 12px; font-weight: 800; padding: 6px 0; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 22px; }
.btn-cancel { border: 1.5px solid var(--line); background: #fff; padding: 10px 18px; border-radius: 12px; font-size: 13.5px; font-weight: 700; color: #4A5468; }
.btn-delete { background: var(--danger-soft); color: var(--danger); padding: 10px 18px; border-radius: 12px; font-size: 13.5px; font-weight: 800; margin-left: auto; }
.btn-primary { background: var(--green); color: #fff; padding: 10px 20px; border-radius: 12px; font-size: 13.5px; font-weight: 800; box-shadow: 0 4px 14px rgba(15, 164, 122, .35); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.err-msg { color: var(--danger); font-size: 12.5px; margin-top: 10px; font-weight: 700; }
.view-header { margin: -24px -24px 16px; padding: 22px 24px 18px; border-radius: 20px 20px 0 0; }
.view-type { font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.view-title { font-size: 19px; font-weight: 800; }
.view-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bg); }
.view-label { width: 90px; font-size: 12px; font-weight: 800; color: var(--faint); flex-shrink: 0; padding-top: 2px; }
.view-value { font-size: 13.5px; font-weight: 600; }
.lock-note { font-size: 11.5px; color: var(--faint); margin-left: auto; }

/* ---------- toast و فوتر ---------- */
.toast { position: fixed; bottom: 24px; right: 50%; transform: translateX(50%); background: var(--ink); color: #fff; padding: 11px 22px; border-radius: 12px; font-size: 13.5px; font-weight: 700; box-shadow: 0 8px 24px rgba(12, 18, 36, .35); z-index: 60; animation: modalIn .2s; }
.footer { text-align: center; font-size: 11.5px; color: var(--faint); padding: 10px 0 20px; }

@media (max-width: 720px) {
  .grid7 { font-size: 11px; gap: 4px; }
  .cell { min-height: 84px; padding: 5px; }
  .bar-label { width: 90px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- نسخه ۲: چندانتخابی، کمپین‌ها، تاریخچه ---------- */
.multi-row { display: flex; gap: 7px; flex-wrap: wrap; }
.pill-sm { padding: 5px 12px; font-size: 12px; }
.pill-disabled { opacity: .35; cursor: not-allowed; }
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.modal-lg { max-width: 640px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #4A5468; cursor: pointer; margin-bottom: 8px; }
.check-row input { width: auto; }
.action-row { display: flex; gap: 6px; align-items: center; margin-bottom: 7px; }
.action-row input[type="checkbox"] { width: auto; flex-shrink: 0; }
.btn-x { background: var(--danger-soft); color: var(--danger); width: 32px; height: 32px; border-radius: 9px; font-weight: 800; flex-shrink: 0; }
.action-row-view { display: flex; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--bg); font-size: 13px; }
.action-row-view.done { color: var(--faint); text-decoration: line-through; }
.action-row-view.done .badge-gray { text-decoration: none; }
.cd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.cd-stat { background: var(--bg); border-radius: 11px; padding: 10px 12px; font-size: 12.5px; }
.cd-block { background: #FAFBFD; border: 1px solid var(--bg); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.cd-title { font-size: 12.5px; font-weight: 800; color: #4A5468; margin-bottom: 7px; }
.cd-text { font-size: 13px; line-height: 1.9; }
.camp-link-btn { display: block; width: 100%; margin-top: 14px; background: #E1E6F8; color: var(--primary); padding: 12px; border-radius: 12px; font-size: 13.5px; font-weight: 800; text-align: center; transition: filter .15s; }
.camp-link-btn:hover { filter: brightness(.95); }
.hist-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--bg); }
.hist-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.hist-main { font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.hist-details { font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.hist-time { font-size: 11px; color: var(--faint); flex-shrink: 0; white-space: nowrap; padding-top: 3px; }
@media (max-width: 600px) { .cd-grid { grid-template-columns: 1fr; } .hist-time { display: none; } }
