/* ============================================================================
   منصة شغف — Shaghf Platform
   css/admin.css — أنماط صفحة الدخول ولوحة التحكم
   يعتمد على متغيرات css/base.css ومكوّناته المشتركة فقط.
   ========================================================================== */

[hidden] {
  display: none !important;
}

/* ==================================================================== */
/*  1. صفحة تسجيل الدخول                                                */
/* ==================================================================== */

.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

.auth {
  position: relative;
  isolation: isolate;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.2rem, 4vh, 2.8rem) 0;
}

.auth__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.05rem;
}

/* زخارف عائمة حول البطاقة */
.auth__deco {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.auth__float {
  position: absolute;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 20px;
  font-size: 1.5rem;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.42));
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: auth-float 8s var(--ease) infinite alternate;
}

.auth__float--1 {
  top: 16%;
  inset-inline-start: 7%;
  transform: rotate(-8deg);
  animation-delay: -1.5s;
}

.auth__float--2 {
  bottom: 20%;
  inset-inline-start: 13%;
  transform: rotate(6deg);
  animation-delay: -3.5s;
}

.auth__float--3 {
  top: 22%;
  inset-inline-end: 9%;
  transform: rotate(9deg);
  animation-delay: -2.5s;
}

.auth__float--4 {
  bottom: 15%;
  inset-inline-end: 15%;
  transform: rotate(-6deg);
  animation-delay: -4.5s;
}

@keyframes auth-float {
  from { translate: 0 0; }
  to { translate: 0 -14px; }
}

/* بطاقة الدخول */
.auth-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(462px, 100%);
  padding: clamp(1.5rem, 4vw, 2.3rem);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(216, 203, 255, 0.62), rgba(255, 255, 255, 0) 62%),
    radial-gradient(95% 65% at 0% 100%, rgba(253, 232, 242, 0.75), rgba(255, 255, 255, 0) 66%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.72));
}

.auth-card::before {
  content: '';
  position: absolute;
  inset-inline-end: -70px;
  top: -80px;
  z-index: -1;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, #d9ccff, #f3e8ff 62%, transparent 72%);
  filter: blur(26px);
  opacity: 0.85;
  pointer-events: none;
}

.auth-card::after {
  content: '';
  position: absolute;
  inset-inline-start: -90px;
  bottom: -100px;
  z-index: -1;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd9ec, #fdf2f8 60%, transparent 72%);
  filter: blur(30px);
  opacity: 0.8;
  pointer-events: none;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.auth-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  font-size: 1.5rem;
  background: linear-gradient(140deg, #8b5cf6 0%, #ec4899 62%, #f59e0b 118%);
  box-shadow: 0 16px 32px -14px rgba(139, 92, 246, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.auth-brand__text {
  flex: 1 1 auto;
  min-width: 0;
}

.auth-brand__title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}

.auth-brand__tag {
  margin-top: 0.1rem;
  font-size: 0.77rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.auth-chip {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(124, 92, 255, 0.11);
  color: var(--violet-deep);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.auth-head {
  margin-top: 1.4rem;
}

.auth-title {
  margin-top: 0.2rem;
  font-size: clamp(1.55rem, 4.5vw, 1.95rem);
}

.auth-lead {
  margin-top: 0.4rem;
  font-size: 0.92rem;
  line-height: 1.85;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin-top: 1.3rem;
}

.auth-control {
  position: relative;
}

.auth-control .input {
  min-height: 52px;
  padding-inline-start: 2.85rem;
  padding-inline-end: 1rem;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 600;
}

.auth-control--password .input {
  padding-inline-end: 3.1rem;
}

.auth-control__icon {
  position: absolute;
  inset-inline-start: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  line-height: 1;
  opacity: 0.75;
  pointer-events: none;
}

.auth-toggle {
  position: absolute;
  inset-inline-end: 0.38rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.02rem;
  line-height: 1;
  color: var(--ink-faint);
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.auth-toggle:hover {
  background: rgba(124, 92, 255, 0.1);
  color: var(--violet-deep);
}

.auth-error {
  margin-top: 0.05rem;
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.72rem 0.9rem;
  border: 1px solid #fecdd3;
  border-radius: var(--radius-sm);
  background: #fff1f2;
  color: #9f1239;
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.7;
}

.auth-alert__icon {
  flex: 0 0 auto;
  line-height: 1.5;
}

.auth-submit {
  margin-top: 0.3rem;
  min-height: 54px;
}

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.74rem;
  line-height: 1.75;
  color: var(--ink-faint);
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.05rem;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--ink-soft);
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease),
    border-color var(--speed) var(--ease);
}

.auth-back:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--violet-deep);
  text-decoration: none;
}

/* ==================================================================== */
/*  2. لوحة التحكم — الشريط العلوي                                      */
/* ==================================================================== */

.dash-page {
  min-height: 100vh;
  min-height: 100svh;
}

.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-block: 0.55rem;
  background: rgba(251, 248, 255, 0.74);
  border-bottom: 1px solid rgba(124, 92, 255, 0.1);
  box-shadow: 0 14px 34px -34px rgba(43, 36, 64, 0.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
}

.dash-topbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  min-height: 64px;
}

.dash-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-inline-end: auto;
  padding: 0.15rem 0.35rem 0.15rem 0;
  border-radius: var(--radius-full);
  color: inherit;
  text-decoration: none;
}

.dash-brand:hover {
  text-decoration: none;
}

.dash-brand__mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  font-size: 1.22rem;
  background: linear-gradient(140deg, #8b5cf6, #ec4899 68%, #f59e0b);
  box-shadow: 0 12px 24px -12px rgba(139, 92, 246, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.dash-brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.dash-brand__title {
  max-width: 24ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 1.01rem;
  font-weight: 800;
  color: var(--ink);
}

.dash-brand__sub {
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}

.dash-user {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-block: 0.28rem;
  padding-inline-start: 0.3rem;
  padding-inline-end: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-xs);
}

.dash-user__avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(140deg, #a78bfa, #f9a8d4);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.dash-user__name {
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.dash-topbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

/* ==================================================================== */
/*  3. رأس الصفحة والتبويبات                                            */
/* ==================================================================== */

.dash-main {
  padding-block: clamp(1.2rem, 3vw, 2.1rem) 3rem;
}

.dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.7rem 1.2rem;
  margin-bottom: 1.25rem;
}

.dash-hero__text {
  min-width: 0;
}

.dash-hero__title {
  margin-top: 0.12rem;
  font-size: clamp(1.5rem, 3.4vw, 2.05rem);
}

.dash-hero__sub {
  max-width: 62ch;
  margin-top: 0.35rem;
  font-size: 0.94rem;
}

.dash-hero__stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.7rem;
  padding: 0.48rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-xs);
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}

.dash-tabs {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 1.45rem;
  padding: 0.34rem;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.dash-tabs::-webkit-scrollbar {
  display: none;
}

.dash-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 44px;
  padding: 0.5rem 1.05rem;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.89rem;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease),
    box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.dash-tab:hover {
  background: rgba(124, 92, 255, 0.08);
  color: var(--violet-deep);
}

.dash-tab[aria-selected='true'] {
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #6d5cf6 52%, #4f8ef7);
  box-shadow: 0 12px 26px -14px rgba(109, 92, 246, 0.9);
}

.dash-tab__icon {
  font-size: 1.02rem;
  line-height: 1;
}

.dash-tab__badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding-inline: 0.3rem;
  border-radius: var(--radius-full);
  background: rgba(124, 92, 255, 0.12);
  color: var(--violet-deep);
  font-size: 0.68rem;
  font-weight: 800;
}

.dash-tab[aria-selected='true'] .dash-tab__badge {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

/* ==================================================================== */
/*  4. بطاقات الإحصاءات وشريط الأدوات                                   */
/* ==================================================================== */

.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.2rem;
}

.dash-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1rem 1.05rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.62));
  box-shadow: var(--shadow-sm);
}

.dash-stat::after {
  content: '';
  position: absolute;
  inset-inline-end: -24px;
  top: -24px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--tone);
  opacity: 0.13;
  pointer-events: none;
}

.dash-stat__top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.28rem;
}

.dash-stat__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--tone-soft);
  font-size: 0.98rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.dash-stat__label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.dash-stat__value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.dash-stat__value--sm {
  overflow-wrap: anywhere;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.dash-stat--violet { --tone: #7c5cff; --tone-soft: #efeafd; }
.dash-stat--pink { --tone: #ec4899; --tone-soft: #fde8f2; }
.dash-stat--mint { --tone: #10b981; --tone-soft: #e0f8ee; }
.dash-stat--amber { --tone: #f59e0b; --tone-soft: #fdf4dc; }

.dash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.85rem;
  margin-bottom: 1.1rem;
}

.dash-search {
  position: relative;
  flex: 1 1 280px;
  max-width: 430px;
}

.dash-search .input {
  padding-inline-start: 2.7rem;
  padding-inline-end: 2.7rem;
  background: rgba(255, 255, 255, 0.8);
}

.dash-search .input::-webkit-search-decoration,
.dash-search .input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.dash-search__icon {
  position: absolute;
  inset-inline-start: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  opacity: 0.8;
  pointer-events: none;
}

.dash-search__clear {
  position: absolute;
  inset-inline-end: 0.35rem;
  top: 50%;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--ink-faint);
  font-size: 0.82rem;
  transform: translateY(-50%);
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}

.dash-search__clear:hover {
  background: #fff;
  color: #be123c;
}

.dash-toolbar__meta {
  margin-inline-start: auto;
  font-size: 0.81rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.dash-toolbar__add {
  flex: 0 0 auto;
}

/* ==================================================================== */
/*  5. بطاقات الفصول والطلاب                                            */
/* ==================================================================== */

.dash-classrooms {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.dash-classroom {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.dash-classroom__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1.05rem 1.2rem;
  border-bottom: 1px solid rgba(124, 92, 255, 0.09);
  background: linear-gradient(125deg, var(--c-soft), rgba(255, 255, 255, 0.5) 62%, rgba(255, 255, 255, 0));
}

.dash-classroom__identity {
  display: flex;
  flex: 1 1 260px;
  align-items: center;
  gap: 0.78rem;
  min-width: 0;
}

.dash-classroom__badge {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 17px;
  background: linear-gradient(140deg, var(--c1), var(--c2));
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 13px 26px -14px var(--c1), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.dash-classroom__id {
  min-width: 0;
}

.dash-classroom__name {
  font-family: var(--font-display);
  font-size: 1.09rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink);
}

.dash-classroom__teacher {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  margin-top: 0.1rem;
  font-size: 0.81rem;
  color: var(--ink-soft);
}

.dash-classroom__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-inline-start: auto;
}

.dash-classroom__count {
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.78);
  color: var(--c-ink);
  box-shadow: var(--shadow-xs);
}

.dash-classroom__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
}

.dash-classroom__body {
  padding: 1rem 1.2rem 1.2rem;
}

.dash-students {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.7rem;
}

.dash-student {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.78rem 0.85rem;
  border: 1px solid rgba(124, 92, 255, 0.1);
  border-radius: var(--radius-md);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.94), rgba(252, 249, 255, 0.72));
  box-shadow: var(--shadow-xs);
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease),
    border-color var(--speed) var(--ease);
}

.dash-student:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.dash-student__top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.dash-student__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 13px;
  background: linear-gradient(145deg, var(--c-soft), #fff);
  font-size: 1.08rem;
  box-shadow: inset 0 1px 0 #fff;
}

.dash-student__id {
  flex: 1 1 auto;
  min-width: 0;
}

.dash-student__name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.93rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--ink);
}

.dash-student__dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c1);
  box-shadow: 0 0 0 3px var(--c-soft);
}

.dash-student__teacher {
  overflow: hidden;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--ink-faint);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-student__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.08rem;
}

.dash-student__msg {
  display: -webkit-box;
  min-height: 2.9em;
  margin-top: 0.05rem;
  padding-top: 0.42rem;
  overflow: hidden;
  border-top: 1px dashed rgba(124, 92, 255, 0.13);
  font-size: 0.79rem;
  line-height: 1.75;
  color: var(--ink-soft);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dash-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease),
    border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.dash-icon-btn:hover {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--violet-deep);
  transform: translateY(-1px);
}

.dash-icon-btn:active {
  transform: translateY(0);
}

.dash-icon-btn:disabled {
  border-color: transparent;
  background: transparent;
  opacity: 0.32;
  cursor: not-allowed;
  transform: none;
}

.dash-icon-btn--danger:hover {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.dash-classroom__empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 0.85rem 1rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.45);
  font-size: 0.84rem;
  color: var(--ink-soft);
}

.dash-empty {
  margin-top: 0.25rem;
}

.dash-empty .empty-state__text {
  margin-bottom: 0.35rem;
}

/* ==================================================================== */
/*  6. بطاقات الإعدادات والنسخ الاحتياطي                                */
/* ==================================================================== */

.dash-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 1rem;
  align-items: start;
}

.dash-card {
  padding: 1.3rem;
  border-radius: var(--radius-lg);
}

.dash-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 1.05rem;
}

.dash-card__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f1ecff, #fde8f2);
  font-size: 1.14rem;
  box-shadow: inset 0 1px 0 #fff;
}

.dash-card__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}

.dash-card__sub {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.dash-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.dash-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.dash-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1rem;
}

.dash-note {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-top: 0.9rem;
  font-size: 0.73rem;
  line-height: 1.75;
  color: var(--ink-faint);
}

.dash-note--center {
  justify-content: center;
  margin-top: 1.4rem;
  text-align: center;
}

.dash-alert {
  padding: 0.65rem 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.7;
}

.dash-alert--error {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #9f1239;
}

.dash-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.75;
}

.dash-banner__icon {
  flex: 0 0 auto;
  font-size: 1.02rem;
  line-height: 1.5;
}

.dash-banner__body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.dash-banner__title {
  font-weight: 800;
}

.dash-banner--amber {
  border-color: #fde68a;
  background: #fffaeb;
  color: #92400e;
}

.dash-banner--rose {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #9f1239;
}

.dash-code {
  display: inline-block;
  padding: 0.02rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--violet-deep);
  direction: ltr;
  unicode-bidi: embed;
}

.dash-summary {
  margin-bottom: 1rem;
}

.dash-summary .dash-card__head {
  align-items: center;
  margin-bottom: 1rem;
}

.dash-summary__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 0.6rem;
}

.dash-summary__item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.55);
}

.dash-summary__label {
  font-size: 0.71rem;
  font-weight: 700;
  color: var(--ink-faint);
}

.dash-summary__value {
  font-family: var(--font-display);
  font-size: 1.04rem;
  font-weight: 800;
  color: var(--ink);
}

.dash-summary__value--sm {
  overflow-wrap: anywhere;
  font-family: var(--font-body);
  font-size: 0.77rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink-soft);
}

.dash-summary .badge {
  margin-inline-start: auto;
}

.dash-backup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.dash-action-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-action-card__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(145deg, #efeafd, #fde8f2);
  font-size: 1.24rem;
  box-shadow: inset 0 1px 0 #fff;
}

.dash-action-card--export .dash-action-card__icon {
  background: linear-gradient(145deg, #efeafd, #e0e7ff);
}

.dash-action-card--import .dash-action-card__icon {
  background: linear-gradient(145deg, #e3f3fd, #e0f8ee);
}

.dash-action-card--danger {
  border-color: rgba(225, 29, 72, 0.16);
}

.dash-action-card--danger .dash-action-card__icon {
  background: linear-gradient(145deg, #ffe7eb, #fff1f2);
}

.dash-action-card__title {
  font-family: var(--font-display);
  font-size: 1.01rem;
  font-weight: 800;
  color: var(--ink);
}

.dash-action-card__text {
  flex: 1 1 auto;
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.dash-action-card__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

/* ==================================================================== */
/*  7. النوافذ المنبثقة: المنتقيات والمعاينة                            */
/* ==================================================================== */

.dash-picker {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dash-picker__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
}

.dash-picker__title {
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--ink);
}

.dash-picker__hint {
  font-size: 0.73rem;
  color: var(--ink-faint);
}

.dash-picker__value {
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(124, 92, 255, 0.1);
  color: var(--violet-deep);
  font-size: 0.75rem;
  font-weight: 800;
}

.dash-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 0.3rem;
  max-height: 154px;
  padding: 0.45rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
}

.dash-icon-opt {
  display: grid;
  place-items: center;
  min-height: 38px;
  aspect-ratio: 1 / 1;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font-size: 1.02rem;
  line-height: 1;
  transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease),
    transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.dash-icon-opt:hover {
  background: #fff;
  transform: translateY(-1px);
}

.dash-icon-opt[aria-pressed='true'] {
  border-color: rgba(124, 92, 255, 0.5);
  background: linear-gradient(145deg, #f1ecff, #efe7ff);
  box-shadow: 0 6px 14px -10px rgba(124, 92, 255, 0.85);
}

.dash-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.35rem;
}

.dash-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.35rem 0.55rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
  transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease),
    color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}

.dash-swatch__dot {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65);
}

.dash-swatch:hover {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.dash-swatch[aria-pressed='true'] {
  border-color: var(--sw);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 18px -12px var(--sw);
}

.dash-preview-slot {
  min-height: 92px;
}

.dash-preview {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, var(--c-soft), rgba(255, 255, 255, 0.88));
  box-shadow: var(--shadow-sm);
}

.dash-preview__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(140deg, var(--c1), var(--c2));
  color: #fff;
  font-size: 1.28rem;
  box-shadow: 0 10px 20px -12px var(--c1);
}

.dash-preview__body {
  min-width: 0;
}

.dash-preview__name {
  font-family: var(--font-display);
  font-size: 0.97rem;
  font-weight: 800;
  color: var(--ink);
}

.dash-preview__teacher {
  margin-top: 0.04rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.dash-preview__meta {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c-ink);
}

.dash-preview__msg {
  display: -webkit-box;
  margin-top: 0.25rem;
  overflow: hidden;
  font-size: 0.79rem;
  line-height: 1.75;
  color: var(--ink-soft);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* ==================================================================== */
/*  8. الاستجابة للشاشات الصغيرة                                        */
/* ==================================================================== */

@media (max-width: 1080px) {
  .auth__deco {
    display: none;
  }
}

@media (max-width: 960px) {
  .dash-settings-grid {
    grid-template-columns: 1fr;
  }

  .dash-backup-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-stat__value {
    font-size: 1.55rem;
  }
}

@media (max-width: 760px) {
  .dash-topbar__inner {
    gap: 0.5rem;
  }

  .dash-brand {
    flex: 1 1 auto;
    margin-inline-end: 0;
  }

  .dash-brand__mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    font-size: 1.08rem;
  }

  .dash-brand__title {
    max-width: 16ch;
  }

  .dash-user {
    order: 2;
  }

  .dash-topbar__actions {
    order: 3;
    flex: 1 1 100%;
    gap: 0.4rem;
  }

  .dash-topbar__actions .btn {
    flex: 1 1 0;
  }

  .dash-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-backup-grid {
    grid-template-columns: 1fr;
  }

  .dash-form__grid {
    grid-template-columns: 1fr;
  }

  .dash-hero {
    align-items: flex-start;
  }

  .dash-toolbar__meta {
    order: 3;
    flex: 1 1 100%;
    margin-inline-start: 0;
  }

  .dash-toolbar__add {
    order: 2;
    margin-inline-start: auto;
  }

  .dash-search {
    order: 1;
    flex: 1 1 100%;
    max-width: none;
  }

  .dash-classroom__meta {
    width: 100%;
    margin-inline-start: 0;
    justify-content: space-between;
  }

  .dash-classroom__head {
    padding: 1rem;
  }

  .dash-classroom__body {
    padding: 0.9rem 1rem 1rem;
  }

  .dash-students {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .dash-tabs {
    width: 100%;
  }

  .dash-tab {
    flex: 1 0 auto;
    padding-inline: 0.78rem;
    font-size: 0.84rem;
  }

  .dash-hero__stamp {
    display: none;
  }

  .dash-classroom__badge {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 1.3rem;
  }

  .dash-user__name {
    max-width: 9ch;
  }

  .dash-topbar__actions .btn {
    font-size: 0.8rem;
    padding-inline: 0.8rem;
  }

  .dash-topbar__actions .btn span[aria-hidden='true'] {
    display: none;
  }
}

@media (max-width: 430px) {
  .auth-card {
    padding: 1.3rem 1.1rem 1.4rem;
  }

  .auth-brand {
    gap: 0.6rem;
  }

  .auth-mark {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    font-size: 1.32rem;
  }

  .auth-chip {
    display: none;
  }

  .auth-title {
    font-size: 1.5rem;
  }

  .dash-main {
    padding-top: 1rem;
  }

  .dash-stat {
    padding: 0.8rem 0.85rem;
  }

  .dash-stat__icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 0.88rem;
  }

  .dash-stat__label {
    font-size: 0.72rem;
  }

  .dash-stat__value {
    font-size: 1.42rem;
  }

  .dash-stat__value--sm {
    font-size: 0.76rem;
  }

  .dash-tabs {
    gap: 0.14rem;
    padding: 0.28rem;
  }

  .dash-tab {
    gap: 0.28rem;
    padding-inline: 0.5rem;
    font-size: 0.78rem;
  }

  .dash-tab__icon {
    display: none;
  }

  .dash-tab__badge {
    min-width: 18px;
    height: 18px;
    padding-inline: 0.22rem;
    font-size: 0.64rem;
  }

  .dash-icon-btn {
    font-size: 0.86rem;
  }

  .dash-card {
    padding: 1.05rem;
  }

  .dash-summary__grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-user {
    padding-inline-end: 0.55rem;
  }

  .dash-user__name {
    max-width: 7ch;
  }

  .dash-brand__sub {
    display: none;
  }

  .dash-preview__msg {
    -webkit-line-clamp: 2;
  }
}

/* ==================================================================== */
/*  إضافات: حقوق الإشراف وتذييل الصفحات                                  */
/* ==================================================================== */

.auth-credit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
  padding: 0.35rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-xs);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-faint);
  text-align: center;
}

.auth-credit strong {
  color: #9d174d;
  font-weight: 800;
}

.dash-hero__stamp--credit {
  background: linear-gradient(135deg, #fff1f9 0%, #ffffff 100%);
  border-color: #ffd2e8;
}

.dash-hero__stamp--credit strong {
  color: #9d174d;
  font-weight: 800;
}

.dash-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.dash-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  padding-block: 1.1rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.dash-footer__inner strong {
  color: #9d174d;
  font-weight: 800;
}

.dash-footer__inner a {
  color: var(--ink-soft);
  font-weight: 700;
}

.dash-footer__inner a:hover {
  color: var(--violet-deep);
}

@media (max-width: 600px) {
  .dash-footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .auth-credit {
    font-size: 0.72rem;
  }
}

/* ملاحظة معلوماتية داخل نماذج لوحة التحكم */
.dash-info-note {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border: 1.5px dashed #ffd2e8;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff8fc 0%, #ffffff 100%);
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.85;
}

.dash-info-note__icon {
  font-size: 1.25rem;
  line-height: 1.45;
}

.dash-info-note p {
  margin: 0;
}

/* عند تفضيل تقليل الحركة تُلغى حركات الزخارف في base.css تلقائيًا */


/* ==================================================================== */
/*  Premium refinements (v4) â€” ØªÙØ­Ù…Ù‘Ù„ Ø¨Ø¹Ø¯ Ù‚ÙˆØ§Ø¹Ø¯ Ø§Ù„ØªØµÙ…ÙŠÙ… Ø§Ù„Ø£ØµÙ„ÙŠØ©          */
/* ==================================================================== */

.auth-card {
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(160deg, #fffdf9 0%, #fbf7f1 100%);
  box-shadow: 0 42px 100px -48px rgba(45, 32, 64, 0.45), inset 0 1px 0 #fff;
}

.auth-card::before {
  opacity: 0.42;
}

.auth-card::after {
  opacity: 0.34;
}

.auth-mark,
.dash-brand__mark {
  background: linear-gradient(140deg, #5a46aa 0%, #7a63cc 55%, #9b6cb8 100%);
  box-shadow: 0 16px 34px -16px rgba(90, 70, 170, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.auth-chip {
  background: #f1edfb;
  color: var(--violet-deep);
  border: 1px solid rgba(109, 88, 201, 0.14);
}

.dash-topbar {
  background: rgba(255, 252, 247, 0.84);
  border-bottom-color: var(--line);
  box-shadow: 0 18px 40px -40px rgba(45, 32, 64, 0.5);
}

.dash-hero__stamp {
  background: rgba(255, 252, 247, 0.7);
  border-color: var(--line);
}

.dash-tabbar,
.dash-tabs {
  border-color: rgba(255, 255, 255, 0.85);
}

.dash-tab[aria-selected='true'] {
  background: linear-gradient(135deg, #5a46aa 0%, #7a63cc 100%);
  color: #fff;
  box-shadow: 0 10px 22px -16px rgba(90, 70, 170, 0.75);
}

.dash-stat {
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-top: 2px solid var(--tone);
  border-radius: var(--radius-md);
  background: #fffdf9;
  box-shadow: 0 20px 42px -38px rgba(45, 32, 64, 0.35);
}

.dash-stat::after {
  opacity: 0.055;
}

.dash-stat__icon {
  border-radius: 10px;
}

.dash-stat--violet { --tone: #6d58c9; --tone-soft: #f1edfb; }
.dash-stat--pink { --tone: #c16183; --tone-soft: #fbeef3; }
.dash-stat--mint { --tone: #5f8f7f; --tone-soft: #ebf5f0; }
.dash-stat--amber { --tone: #b98a3f; --tone-soft: #faf1df; }

.dash-stat__value {
  color: var(--ink);
}

.dash-student {
  border-color: var(--line);
  background: #fffdfa;
  box-shadow: 0 14px 30px -30px rgba(45, 32, 64, 0.35);
}

.dash-student:hover {
  border-color: var(--line-strong);
  box-shadow: 0 22px 40px -32px rgba(45, 32, 64, 0.4);
}

.dash-student__icon {
  border-color: rgba(255, 255, 255, 0.9);
  background: var(--c-soft);
}

.dash-classroom {
  box-shadow: 0 28px 62px -54px rgba(45, 32, 64, 0.38);
}

.dash-icon-btn {
  border-radius: 9px;
  color: var(--ink-soft);
}

.dash-icon-btn:hover {
  background: rgba(109, 88, 201, 0.08);
  color: var(--violet-deep);
}

.dash-entry-card,
.dash-action-card,
.dash-card {
  border-color: rgba(255, 255, 255, 0.9);
}

.dash-preview,
.dash-preview--student {
  border-color: var(--line);
}

.dash-info-note {
  border-color: #eedfc8;
  background: linear-gradient(135deg, #fdf8ef 0%, #fffdf9 100%);
  color: var(--ink-soft);
}

.dash-footer {
  background: #241c2f;
  color: rgba(255, 255, 255, 0.68);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-footer__inner strong {
  color: #e8c98f;
}

.dash-footer__inner a {
  color: rgba(255, 255, 255, 0.72);
}

.dash-footer__inner a:hover {
  color: #e8c98f;
}

/* Login page: quiet the floating decorations on small screens */
@media (max-width: 700px) {
  .auth__deco {
    opacity: 0.4;
  }
}


/* login: clean premium background */
.auth__deco { display: none; }
