/* ============================================================
   MCI EDUCATION — Dashboard styles
   ============================================================ */

body.dashboard-body { padding-top: 0; background: var(--ap-bg); }

.dash-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
@media (max-width: 991.98px) { .dash-shell { grid-template-columns: 1fr; } }

/* Backdrop must NEVER occupy a grid cell — always taken out of normal flow */
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1040; opacity: 0; pointer-events: none; transition: .25s; }
.sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
@media (min-width: 992px) { .sidebar-backdrop { display: none; } }

/* ===========================================================
   SIDEBAR
   =========================================================== */
.dash-sidebar {
  background: var(--mci-navy-deep);
  color: rgba(255,255,255,.75);
  padding: 1.4rem 1rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: .25rem;
  border-right: 1px solid rgba(255,255,255,.05);
}
[dir="rtl"] .dash-sidebar { border-right: none; border-left: 1px solid rgba(255,255,255,.05); }
@media (max-width: 991.98px) {
  .dash-sidebar {
    position: fixed; top: 0; left: 0; height: 100vh;
    width: 280px; z-index: 1050;
    transform: translateX(-100%); transition: transform .3s;
  }
  [dir="rtl"] .dash-sidebar { left: auto; right: 0; transform: translateX(100%); }
  .dash-sidebar.open { transform: translateX(0); }
}

.sb-brand {
  display: flex; align-items: center; gap: .55rem;
  color: #fff; font-weight: 800; font-size: 1.05rem;
  padding: .35rem .65rem 1rem;
  text-decoration: none;
}
.sb-brand img { height: 38px; }
.sb-brand .brand-text { font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1; }
.sb-brand .brand-text small { display: block; font-size: .58rem; color: var(--mci-orange); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }

.sb-section {
  padding: 1rem .8rem .4rem;
  font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
  color: rgba(255,255,255,.4); font-weight: 700;
}
.sb-link {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem .85rem; border-radius: 11px;
  color: rgba(255,255,255,.75); text-decoration: none;
  font-weight: 500; font-size: .92rem;
  transition: .15s; position: relative;
}
.sb-link i { font-size: 1.1rem; width: 22px; text-align: center; }
.sb-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-link.active {
  background: linear-gradient(135deg, rgba(247,148,29,.18), rgba(247,148,29,.04));
  color: #fff; font-weight: 600;
}
.sb-link.active::before {
  content:""; position:absolute; left:0; top:10%; bottom:10%;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--mci-orange);
}
[dir="rtl"] .sb-link.active::before { left: auto; right: 0; border-radius: 3px 0 0 3px; }
.sb-link .badge { margin-left: auto; }
[dir="rtl"] .sb-link .badge { margin-left: 0; margin-right: auto; }

.sb-user {
  margin-top: auto; padding: 1rem .85rem;
  background: rgba(255,255,255,.05); border-radius: 14px;
  display: flex; align-items: center; gap: .7rem; color: #fff;
}
.sb-user .avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--ap-gradient-warm); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.sb-user .name { font-weight: 700; font-size: .9rem; }
.sb-user .role { font-size: .72rem; color: rgba(255,255,255,.55); }

/* ===========================================================
   MAIN
   =========================================================== */
.dash-main { display: flex; flex-direction: column; min-width: 0; }

.dash-topbar {
  background: #fff; padding: .9rem 1.5rem;
  border-bottom: 1px solid var(--ap-border);
  display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 50;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--ap-border); background: #fff;
  display: grid; place-items: center; color: var(--ap-text);
  position: relative; transition: .15s;
}
.icon-btn:hover { border-color: var(--mci-orange); color: var(--mci-orange); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--mci-orange); border: 2px solid #fff; }
.topbar-search { flex: 1; max-width: 400px; position: relative; }
.topbar-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ap-muted); }
[dir="rtl"] .topbar-search i { left: auto; right: 14px; }
.topbar-search input { width: 100%; border: 1px solid var(--ap-border); padding: .55rem 1rem .55rem 38px; border-radius: 11px; background: #f8fafc; }
[dir="rtl"] .topbar-search input { padding: .55rem 38px .55rem 1rem; }
.topbar-search input:focus { background: #fff; border-color: var(--mci-orange); outline: none; box-shadow: 0 0 0 3px rgba(247,148,29,.15); }
.topbar-actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
[dir="rtl"] .topbar-actions { margin-left: 0; margin-right: auto; }

/* ===========================================================
   CONTENT
   =========================================================== */
.dash-content { padding: 1.8rem; }
.dash-page-title { font-size: 1.6rem; margin-bottom: .25rem; }
.dash-page-sub { color: var(--ap-muted); margin-bottom: 1.5rem; }

.dash-panel {
  background: #fff; border: 1px solid var(--ap-border);
  border-radius: 18px; padding: 1.4rem;
  margin-bottom: 1.2rem;
}
.dash-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: .75rem; }
.dash-panel-title { font-weight: 700; margin: 0; font-size: 1rem; color: var(--ap-dark); }

/* ===========================================================
   STAT CARDS
   =========================================================== */
.stat-card {
  background: #fff; border: 1px solid var(--ap-border);
  border-radius: 18px; padding: 1.4rem;
  height: 100%; transition: .25s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--mci-orange); }
.stat-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.2rem; margin-bottom: .9rem; }
.stat-label { font-size: .82rem; color: var(--ap-muted); font-weight: 600; }
.stat-value { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 1.8rem; color: var(--ap-dark); margin-top: .2rem; line-height: 1.1; }
.stat-trend { font-size: .8rem; margin-top: .5rem; color: var(--ap-muted); }
.stat-trend.up   { color: #047857; }
.stat-trend.down { color: #be123c; }

/* ===========================================================
   TABLES
   =========================================================== */
.dash-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.dash-table thead th {
  background: #f8fafc; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ap-muted); font-weight: 700;
  padding: .9rem 1rem; border-bottom: 1px solid var(--ap-border); white-space: nowrap;
}
.dash-table tbody td { padding: 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; font-size: .9rem; }
.dash-table tbody tr:hover { background: #fbfdff; }
.dash-table tbody tr:last-child td { border-bottom: 0; }

.table-avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--ap-gradient); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .82rem; flex-shrink: 0; }

/* ===========================================================
   PILLS
   =========================================================== */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.pill-pending  { background: #fef3c7; color: #92400e; }
.pill-review   { background: #dbeafe; color: #1e40af; }
.pill-accepted { background: #d1fae5; color: #065f46; }
.pill-rejected { background: #fee2e2; color: #991b1b; }
.pill-paid     { background: #d1fae5; color: #065f46; }
.pill-unpaid   { background: #fef3c7; color: #92400e; }
.pill-inactive { background: #e2e8f0; color: #475569; }

/* ===========================================================
   TIMELINE
   =========================================================== */
.app-timeline { position: relative; padding-left: 2rem; }
[dir="rtl"] .app-timeline { padding-left: 0; padding-right: 2rem; }
.app-timeline::before { content:""; position:absolute; left:8px; top:8px; bottom:8px; width:2px; background: var(--ap-border); }
[dir="rtl"] .app-timeline::before { left: auto; right: 8px; }
.ap-step { position: relative; padding: 0 0 1.5rem; }
.ap-step::before { content:""; position:absolute; left:-2rem; top:4px; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--ap-border); }
[dir="rtl"] .ap-step::before { left: auto; right: -2rem; }
.ap-step.done::before { background: #10b981; border-color: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.15); }
.ap-step.current::before { background: var(--mci-orange); border-color: var(--mci-orange); box-shadow: 0 0 0 4px rgba(247,148,29,.2); animation: pulse 2s infinite; }
.step-title { font-weight: 700; }
.step-meta { color: var(--ap-muted); font-size: .82rem; }

/* ===========================================================
   DOCUMENT CARDS
   =========================================================== */
.doc-card { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.2rem; background: #fff; border: 1.5px dashed #cbd5e1; border-radius: 14px; transition: .2s; }
.doc-card:hover { border-color: var(--mci-orange); background: var(--mci-orange-soft); }
.doc-card.uploaded { border-style: solid; border-color: #a7f3d0; background: #f0fdf4; }
.doc-card .doc-icon { width: 44px; height: 44px; border-radius: 11px; background: var(--mci-orange-soft); color: var(--mci-orange-2); display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.doc-card.uploaded .doc-icon { background: #d1fae5; color: #065f46; }
.doc-card .doc-name { font-weight: 700; font-size: .92rem; }
.doc-card .doc-meta { color: var(--ap-muted); font-size: .8rem; }

/* ===========================================================
   NOTIFICATIONS
   =========================================================== */
.notif-item { display: flex; gap: .9rem; padding: 1rem; border-bottom: 1px solid #f1f5f9; transition: .15s; }
.notif-item:hover { background: #fbfdff; }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: #fffbeb; }
.notif-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; font-size: 1rem; }
.notif-title { font-weight: 700; font-size: .9rem; }
.notif-msg   { color: var(--ap-muted); font-size: .85rem; margin-top: .15rem; }
.notif-time  { color: var(--ap-muted); font-size: .75rem; margin-top: .25rem; }

/* ===========================================================
   BAR CHARTS (Analytics)
   =========================================================== */
.bar-row { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 1rem; margin-bottom: .65rem; font-size: .85rem; }
.bar-row .label { font-weight: 600; color: var(--ap-text); }
.bar-track { background: #f1f5f9; border-radius: 999px; height: 22px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--ap-gradient); display: flex; align-items: center; justify-content: flex-end; padding-right: .6rem; color: #fff; font-weight: 700; font-size: .72rem; transition: width .8s ease; }
[dir="rtl"] .bar-fill { padding-right: 0; padding-left: .6rem; }
