/* =========================================================
   BEC — Attendance (modern). Scoped to #attendanceSection.
   Student photo + father's name, status buttons, edit dialog.
   ========================================================= */
#attendanceSection.att-page{
  --a-ink:#0f172a;--a-mute:#64748b;--a-line:#e2e8f0;--a-soft:#f6f8fd;--a-acc:#4f46e5;--a-acc2:#0ea5e9;
  --a-present:#16a34a;--a-absent:#e11d48;--a-late:#d97706;--a-excused:#2563eb;
  background:#fff;padding:clamp(14px,2.4vw,26px);border-radius:22px;
}
#attendanceSection .att-hero{display:flex;flex-wrap:wrap;gap:14px 24px;align-items:flex-end;justify-content:space-between;margin:14px 0 18px}
#attendanceSection .att-hero h2{margin:0 0 6px;font-size:clamp(22px,3.2vw,30px);font-weight:800;letter-spacing:-.3px;color:var(--a-ink)!important}
#attendanceSection .att-hero p{margin:0;max-width:640px;color:var(--a-mute)!important;line-height:1.7}
#attendanceSection .att-tabs{display:inline-flex;gap:4px;padding:5px;background:var(--a-soft);border:1px solid var(--a-line);border-radius:16px}
#attendanceSection .att-tab{border:0;background:transparent;color:var(--a-mute)!important;padding:10px 18px;border-radius:12px;font:inherit;font-weight:700;cursor:pointer;transition:.18s}
#attendanceSection .att-tab.on{background:linear-gradient(135deg,var(--a-acc),var(--a-acc2));color:#fff!important;box-shadow:0 8px 18px -8px rgba(79,70,229,.7)}
#attendanceSection .att-tab:not(.on):hover{background:#fff;color:var(--a-ink)!important}

/* toast */
#attendanceSection .att-toast{display:none;margin:0 0 14px;padding:12px 16px;border-radius:14px;font-weight:600;border:1px solid transparent}
#attendanceSection .att-toast.ok{background:#ecfdf5;color:#065f46!important;border-color:#a7f3d0}
#attendanceSection .att-toast.err{background:#fff1f2;color:#9f1239!important;border-color:#fecdd3}

/* panels & fields */
#attendanceSection .att-panel{background:var(--a-soft);border:1px solid var(--a-line);border-radius:18px;padding:16px;margin-bottom:16px}
#attendanceSection .att-controls{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:14px}
#attendanceSection .att-controls-4{grid-template-columns:repeat(4,minmax(0,1fr))}
#attendanceSection .att-field{display:flex;flex-direction:column;gap:6px;min-width:0}
#attendanceSection .att-field label{font-size:13px;font-weight:700;color:var(--a-mute)!important}
#attendanceSection .att-page input,
#attendanceSection input[type=date],#attendanceSection input[type=search],#attendanceSection input[type=text],#attendanceSection select{
  width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--a-line)!important;border-radius:12px;background:#fff!important;color:var(--a-ink)!important;font:inherit;box-sizing:border-box}
#attendanceSection input:focus,#attendanceSection select:focus{outline:0;border-color:var(--a-acc)!important;box-shadow:0 0 0 3px rgba(79,70,229,.18)}
#attendanceSection .att-hint{color:var(--a-mute)!important;font-size:12px;min-height:16px}
#attendanceSection .att-datebox{display:flex;gap:6px;align-items:center}
#attendanceSection .att-datebox input{flex:1;min-width:0}
#attendanceSection .att-nav{flex:0 0 44px;height:44px;border:1px solid var(--a-line);background:#fff;border-radius:12px;cursor:pointer;font-size:22px;line-height:1;color:var(--a-ink)!important}
#attendanceSection .att-nav:hover{border-color:var(--a-acc)}
#attendanceSection .att-prev::before{content:"‹"}#attendanceSection .att-next::before{content:"›"}
html[dir=rtl] #attendanceSection .att-prev::before{content:"›"}html[dir=rtl] #attendanceSection .att-next::before{content:"‹"}
#attendanceSection .att-today{height:44px;padding:0 14px;border:0;border-radius:12px;background:#e0e7ff;color:#3730a3!important;font:inherit;font-weight:700;cursor:pointer}

/* stats */
#attendanceSection .att-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr)) 1.4fr;gap:12px;margin-bottom:16px}
#attendanceSection .att-stat{--c:#64748b;display:flex;flex-direction:column;gap:6px;align-items:flex-start;padding:14px 16px;border:1px solid var(--a-line);border-top:4px solid var(--c);border-radius:16px;background:#fff;cursor:pointer;font:inherit;text-align:start;transition:.18s}
#attendanceSection .att-stat span{font-size:13px;font-weight:700;color:var(--a-mute)!important}
#attendanceSection .att-stat strong{font-size:28px;line-height:1;color:var(--a-ink)!important}
#attendanceSection .att-stat.present{--c:var(--a-present)}#attendanceSection .att-stat.absent{--c:var(--a-absent)}
#attendanceSection .att-stat.late{--c:var(--a-late)}#attendanceSection .att-stat.excused{--c:var(--a-excused)}
#attendanceSection .att-stat:hover{transform:translateY(-2px);box-shadow:0 10px 22px -14px rgba(15,23,42,.4)}
#attendanceSection .att-stat.on{background:color-mix(in srgb,var(--c) 10%,#fff);border-color:var(--c)}
#attendanceSection .att-rate{display:flex;flex-direction:column;gap:6px;padding:14px 16px;border-radius:16px;color:#fff;background:linear-gradient(135deg,#4f46e5,#0ea5e9)}
#attendanceSection .att-rate span{font-size:13px;font-weight:700;color:#e0f2fe!important}
#attendanceSection .att-rate strong{font-size:28px;line-height:1;color:#fff!important}
#attendanceSection .att-bar{height:8px;border-radius:99px;background:rgba(255,255,255,.3);overflow:hidden;margin-top:2px}
#attendanceSection .att-bar i{display:block;height:100%;width:0;background:#fff;border-radius:99px;transition:width .35s}

/* buttons */
#attendanceSection .att-actions{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 16px}
#attendanceSection .att-btn{min-height:44px;padding:0 18px;border:0;border-radius:12px;font:inherit;font-weight:700;cursor:pointer;transition:.18s}
#attendanceSection .att-btn:disabled{opacity:.6;cursor:wait}
#attendanceSection .att-btn.primary{background:linear-gradient(135deg,var(--a-acc),var(--a-acc2));color:#fff!important;box-shadow:0 10px 22px -12px rgba(79,70,229,.8)}
#attendanceSection .att-btn.primary:hover{transform:translateY(-1px)}
#attendanceSection .att-btn.soft{background:#eef2ff;color:#3730a3!important}
#attendanceSection .att-btn.soft.ok{background:#dcfce7;color:#166534!important}
#attendanceSection .att-btn.soft.bad{background:#ffe4e6;color:#9f1239!important}
#attendanceSection .att-btn.danger{background:#fff1f2;color:#be123c!important;border:1px solid #fecdd3}

/* roster cards */
#attendanceSection .att-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:14px}
#attendanceSection .att-card{--c:var(--a-present);display:flex;flex-direction:column;gap:12px;padding:14px;background:#fff;border:1px solid var(--a-line);border-inline-start:5px solid var(--c);border-radius:18px;box-shadow:0 6px 18px -14px rgba(15,23,42,.45);transition:border-color .18s,box-shadow .18s}
#attendanceSection .att-card[data-status=absent]{--c:var(--a-absent)}#attendanceSection .att-card[data-status=late]{--c:var(--a-late)}#attendanceSection .att-card[data-status=excused]{--c:var(--a-excused)}
#attendanceSection .att-card:hover{box-shadow:0 14px 28px -16px rgba(15,23,42,.5)}
#attendanceSection .att-card-top{display:flex;gap:12px;align-items:center}
#attendanceSection .att-av{flex:0 0 auto;width:62px;height:62px;border-radius:18px;overflow:hidden;background:#e0e7ff;display:inline-flex;align-items:center;justify-content:center;border:2px solid #fff;box-shadow:0 0 0 1px var(--a-line)}
#attendanceSection .att-av img{width:100%;height:100%;object-fit:cover;object-position:center 15%;cursor:zoom-in}
#attendanceSection .att-av-ph{font-size:24px;font-weight:800;color:#4338ca!important;background:linear-gradient(135deg,#e0e7ff,#cffafe)}
#attendanceSection td .att-av{width:42px;height:42px;border-radius:50%;font-size:17px}
#attendanceSection .att-who{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
#attendanceSection .att-name{font-size:16px;color:var(--a-ink)!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#attendanceSection .att-father{font-size:13px;color:var(--a-mute)!important}
#attendanceSection .att-father em{font-style:normal;font-weight:700;color:#334155!important}
#attendanceSection .att-meta{display:flex;flex-wrap:wrap;gap:6px;font-size:12px}
#attendanceSection .att-meta code,#attendanceSection td code{background:#eef2ff;color:#3730a3!important;padding:2px 8px;border-radius:8px;font-weight:700;font-family:inherit}
#attendanceSection .att-meta span{background:#f1f5f9;color:#475569!important;padding:2px 8px;border-radius:8px}
#attendanceSection .att-state{display:inline-block;padding:3px 10px;border-radius:99px;font-size:11px;font-weight:800;white-space:nowrap}
#attendanceSection .att-state.new{background:#f1f5f9;color:#475569!important}
#attendanceSection .att-state.chg{background:#fef3c7;color:#92400e!important}
#attendanceSection .att-state.ok{background:#dcfce7;color:#166534!important}

/* status buttons (segmented) */
#attendanceSection .att-segs{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
#attendanceSection .att-seg{--c:#64748b;display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 4px;border:1px solid var(--a-line);background:#fff;border-radius:12px;font:inherit;font-size:12px;font-weight:700;color:var(--a-mute)!important;cursor:pointer;transition:.15s}
#attendanceSection .att-seg i{font-style:normal;font-size:15px;line-height:1}
#attendanceSection .att-seg.present{--c:var(--a-present)}#attendanceSection .att-seg.absent{--c:var(--a-absent)}
#attendanceSection .att-seg.late{--c:var(--a-late)}#attendanceSection .att-seg.excused{--c:var(--a-excused)}
#attendanceSection .att-seg:hover{border-color:var(--c);color:var(--c)!important}
#attendanceSection .att-seg.on{background:var(--c);border-color:var(--c);color:#fff!important;box-shadow:0 8px 16px -10px var(--c)}
#attendanceSection .att-note{min-height:40px!important;font-size:14px}

/* save bar */
#attendanceSection .att-savebar{position:sticky;bottom:10px;z-index:5;display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;margin-top:18px;padding:12px 16px;background:rgba(255,255,255,.92);backdrop-filter:blur(10px);border:1px solid var(--a-line);border-radius:18px;box-shadow:0 18px 34px -18px rgba(15,23,42,.5)}
#attendanceSection .att-saveinfo b.warn{color:#b45309!important}#attendanceSection .att-saveinfo b.okk{color:#15803d!important}

/* report table */
#attendanceSection .att-chips{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
#attendanceSection .att-chip{padding:6px 12px;border-radius:99px;background:#f1f5f9;color:#334155!important;font-size:13px}
#attendanceSection .att-chip.present{background:#dcfce7;color:#166534!important}#attendanceSection .att-chip.absent{background:#ffe4e6;color:#9f1239!important}
#attendanceSection .att-chip.late{background:#fef3c7;color:#92400e!important}#attendanceSection .att-chip.excused{background:#dbeafe;color:#1e40af!important}
#attendanceSection .att-tablewrap{overflow-x:auto;border:1px solid var(--a-line);border-radius:18px}
#attendanceSection .att-table{width:100%;border-collapse:collapse;min-width:860px;background:#fff}
#attendanceSection .att-table th{position:sticky;top:0;background:var(--a-soft)!important;color:var(--a-mute)!important;font-size:12px;text-transform:uppercase;letter-spacing:.3px;padding:12px;text-align:start;border-bottom:1px solid var(--a-line)}
#attendanceSection .att-table td{padding:10px 12px;border-bottom:1px solid #eef2f7;color:#1e293b!important;vertical-align:middle}
#attendanceSection .att-table tbody tr:hover{background:#f8faff}
#attendanceSection .att-nowrap{white-space:nowrap}
#attendanceSection .att-badge{display:inline-block;padding:4px 12px;border-radius:99px;font-size:12px;font-weight:800}
#attendanceSection .att-badge.present{background:#dcfce7;color:#166534!important}#attendanceSection .att-badge.absent{background:#ffe4e6;color:#9f1239!important}
#attendanceSection .att-badge.late{background:#fef3c7;color:#92400e!important}#attendanceSection .att-badge.excused{background:#dbeafe;color:#1e40af!important}
#attendanceSection .att-icon-btn{border:1px solid var(--a-line);background:#fff;color:#3730a3!important;border-radius:10px;padding:6px 12px;font:inherit;font-size:13px;font-weight:700;cursor:pointer}
#attendanceSection .att-icon-btn:hover{border-color:var(--a-acc);background:#eef2ff}
#attendanceSection .att-icon-btn.danger{color:#be123c!important}#attendanceSection .att-icon-btn.danger:hover{border-color:#fb7185;background:#fff1f2}
#attendanceSection .att-empty{grid-column:1/-1;text-align:center;padding:34px 12px;color:var(--a-mute)!important;background:var(--a-soft);border:1px dashed #cbd5e1;border-radius:16px}
#attendanceSection td.att-empty{display:table-cell;border:0}

/* edit dialog */
#attendanceSection .att-modal{position:fixed;inset:0;z-index:9000;background:rgba(15,23,42,.55);backdrop-filter:blur(3px);align-items:center;justify-content:center;padding:16px}
#attendanceSection .att-dialog{width:min(480px,100%);max-height:92vh;overflow:auto;background:#fff;border-radius:22px;padding:22px;display:flex;flex-direction:column;gap:14px;box-shadow:0 30px 60px -20px rgba(0,0,0,.5)}
#attendanceSection .att-dialog h3{margin:0;font-size:20px;color:var(--a-ink)!important}
#attendanceSection .att-editwho{display:flex;gap:12px;align-items:center;padding:12px;background:var(--a-soft);border-radius:16px}
#attendanceSection .att-editwho div{display:flex;flex-direction:column;gap:2px}
#attendanceSection .att-editwho span{font-size:13px;color:var(--a-mute)!important}
#attendanceSection .att-dialog-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
#attendanceSection .att-dialog-actions .primary{flex:1 1 100%}

@media(max-width:900px){
  #attendanceSection .att-controls,#attendanceSection .att-controls-4{grid-template-columns:1fr 1fr}
  #attendanceSection .att-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
  #attendanceSection .att-rate{grid-column:1/-1}
}
@media(max-width:600px){
  #attendanceSection.att-page{padding:12px;border-radius:16px}
  #attendanceSection .att-controls,#attendanceSection .att-controls-4{grid-template-columns:1fr}
  #attendanceSection .att-grid{grid-template-columns:1fr}
  #attendanceSection .att-tabs{width:100%}#attendanceSection .att-tab{flex:1;padding:10px 8px}
  #attendanceSection .att-actions .att-btn,#attendanceSection .att-savebar .att-btn{flex:1 1 100%}
}
@media print{#attendanceSection .att-noprint{display:none!important}}

/* ===== خبرداری او میاشتنی لنډیز ===== */
#attendanceSection .att-alert{margin:0 0 16px;padding:14px 16px;border-radius:18px;background:#fff7ed;border:1px solid #fed7aa}
#attendanceSection .att-alert-head{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;margin-bottom:10px}
#attendanceSection .att-alert-head b{color:#9a3412!important}
#attendanceSection .att-alert-n{display:inline-flex;gap:6px;align-items:center;font-size:13px;color:#9a3412!important}
#attendanceSection .att-alert-n span{color:#9a3412!important}
#attendanceSection .att-alert-n select{width:auto;min-height:34px;padding:4px 8px}
#attendanceSection .att-alert-list{display:flex;flex-wrap:wrap;gap:8px}
#attendanceSection .att-alert-chip{display:flex;gap:10px;align-items:center;padding:6px 12px 6px 8px;border:1px solid #fdba74;background:#fff;border-radius:14px;font:inherit;cursor:pointer;text-align:start}
#attendanceSection .att-alert-chip:hover{background:#ffedd5}
#attendanceSection .att-alert-chip .att-av{width:38px;height:38px;border-radius:50%;font-size:16px}
#attendanceSection .att-alert-chip span{display:flex;flex-direction:column}
#attendanceSection .att-alert-chip b{font-size:14px;color:#7c2d12!important}
#attendanceSection .att-alert-chip small{font-size:12px;color:#9a3412!important}
#attendanceSection .att-streak{align-self:flex-start;padding:2px 10px;border-radius:99px;font-size:11px;font-weight:800;background:#fef3c7;color:#92400e!important}
#attendanceSection .att-streak.hot{background:#ffe4e6;color:#be123c!important}
#attendanceSection .att-ratecell{display:flex;align-items:center;gap:8px;min-width:130px}
#attendanceSection .att-minibar{flex:1;height:8px;border-radius:99px;background:#e2e8f0;overflow:hidden}
#attendanceSection .att-minibar i{display:block;height:100%;border-radius:99px;background:#94a3b8}
#attendanceSection .att-minibar i.good{background:#16a34a}#attendanceSection .att-minibar i.mid{background:#d97706}#attendanceSection .att-minibar i.low{background:#e11d48}
#attendanceSection .att-ratecell b{min-width:42px;color:#334155!important}
#attendanceSection .att-ratecell b.good{color:#15803d!important}#attendanceSection .att-ratecell b.mid{color:#b45309!important}#attendanceSection .att-ratecell b.low{color:#be123c!important}
@media(max-width:600px){#attendanceSection .att-tabs{flex-wrap:wrap}#attendanceSection .att-tab{flex:1 1 30%;font-size:13px}}
#attendanceSection .att-table code{white-space:nowrap}
#attendanceSection #attendanceMonthTable{min-width:1000px}
