/* ==========================================================================
   EduSky Ads Hub — brand.css
   هوية فُصْحَى: شاشة الدخول، قوس المحراب، لافتة الترحيب، بطاقة الإرشاد، الرسوم الفارغة.
   الرموز اللونية في base.css (:root). صور الأستاذ تظهر هنا فقط (الدخول، الترحيب، الإرشاد، تذييل القائمة).
   ========================================================================== */

.avatar.has-photo #userInitial { display: none; }

/* ---------- قوس المحراب (مطابق لقوس الصفحة الرئيسية في موقع الطلاب) ---------- */
.arch-frame {
  position: relative; margin: 0; flex: none;
  block-size: var(--arch-h, 320px); aspect-ratio: 2 / 3;
}
.arch-bk {
  position: absolute; inset: 7% 3% 0;
  background: linear-gradient(180deg, #2a6e59 0%, #173d32 82%);
  -webkit-mask: url('../img/arch-mask.svg') center / 100% 100% no-repeat;
  mask: url('../img/arch-mask.svg') center / 100% 100% no-repeat;
}
.arch-bk::after { content: ''; position: absolute; inset: 0; opacity: 0.5; background: url('../img/pattern-khatam-dark.svg') 0 0 / 64px 64px; filter: brightness(2.2); }
.arch-ol {
  position: absolute; inset: calc(7% - 10px) calc(3% - 10px) 0; pointer-events: none;
  background: url('../img/arch-outline.svg') center / 100% 100% no-repeat; opacity: 0.95;
}
.arch-img {
  position: absolute; inset: 0; inline-size: 100%; block-size: 100%; display: block;
  object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.35));
}
/* مشهد كامل (login-portrait): يملأ القوس بدل القصاصة */
.arch-frame.is-scene .arch-bk { display: none; }
.arch-frame.is-scene .arch-img {
  inset: 7% 3% 0; inline-size: 94%; block-size: 93%; object-fit: cover; object-position: 50% 20%; filter: none;
  -webkit-mask: url('../img/arch-mask.svg') center / 100% 100% no-repeat;
  mask: url('../img/arch-mask.svg') center / 100% 100% no-repeat;
}

/* ==========================================================================
   شاشة الدخول: لوحتان (الهوية + النموذج)
   ========================================================================== */
.gate {
  position: fixed; inset: 0; z-index: 200; overflow-y: auto;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--bg);
}
.gate[hidden] { display: none !important; }
.gate-brand-panel {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-5);
  padding: var(--s-7) var(--s-6) var(--s-6);
  color: #fff; text-align: center;
  background:
    radial-gradient(520px 420px at 50% 42%, rgba(234, 167, 46, 0.22), transparent 70%),
    url('../img/pattern-khatam-dark.svg') 0 0 / 96px 96px,
    linear-gradient(165deg, #0b1411 0%, #0f1c18 50%, #13241f 100%);
}
.gate-brand-panel .brand-lockup { position: absolute; inset-block-start: var(--s-5); inset-inline-start: var(--s-6); }
.gate-arch { --arch-h: min(56vh, 520px); z-index: 1; }
.gate-welcome { z-index: 1; max-inline-size: 420px; }
.gate-welcome h1 { font-size: 24px; font-weight: 800; color: #fff; line-height: 1.5; }
.gate-welcome h1::after { content: ''; display: block; inline-size: 56px; block-size: 3px; border-radius: 2px; background: var(--gold); margin: var(--s-3) auto 0; }
.gate-welcome p { margin-top: var(--s-3); color: var(--navy-text); font-size: 14.5px; }

.gate-form-panel {
  display: flex; align-items: center; justify-content: center; padding: var(--s-6) var(--s-5);
  background: url('../img/pattern-khatam.svg') 0 0 / 96px 96px, var(--bg);
}
.gate-card {
  inline-size: 100%; max-inline-size: 420px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--s-6); box-shadow: var(--shadow-md);
  border-block-start: 4px solid var(--gold);
}
.gate-card-brand { display: none; }
.gate-card h2 { font-size: 22px; font-weight: 800; color: var(--primary-700); }
.gate-card .lead { color: var(--text-2); margin: var(--s-1) 0 var(--s-5); font-size: 13.5px; }
.gate-foot { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--border); text-align: center; font-size: 12px; color: var(--text-3); display: flex; gap: 6px; justify-content: center; align-items: center; }

@media (max-width: 860px) {
  .gate { display: flex; flex-direction: column; }
  .gate[hidden] { display: none !important; }
  .gate-brand-panel { flex: none; flex-direction: row; justify-content: flex-start; align-items: flex-end; gap: var(--s-4); padding: var(--s-5) var(--s-5) 0; text-align: start; }
  .gate-brand-panel .brand-lockup { display: none; }
  .gate-arch { --arch-h: 196px; }
  .gate-welcome { align-self: center; padding-block-end: var(--s-4); }
  .gate-welcome h1 { font-size: 17px; }
  .gate-welcome h1::after { margin-inline: 0; }
  .gate-welcome p { font-size: 13px; }
  .gate-form-panel { flex: 1; align-items: flex-start; padding: var(--s-4) var(--s-4) var(--s-6); }
  .gate-card { padding: var(--s-5); }
  .gate-card-brand { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
  .gate-card-brand .brand-name { color: var(--primary-700); }
  .gate-card-brand .brand-name span { color: var(--gold-600); }
  .gate-card-brand .brand-x { color: var(--gold-600); }
}

/* ==========================================================================
   لافتة الترحيب (نظرة عامة)
   ========================================================================== */
.welcome {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: var(--s-5);
  min-block-size: 190px; padding: var(--s-5) var(--s-6);
  border-radius: var(--r-xl); color: #fff;
  background:
    radial-gradient(420px 260px at 8% 50%, rgba(234, 167, 46, 0.18), transparent 70%),
    url('../img/pattern-khatam-dark.svg') 0 0 / 96px 96px,
    linear-gradient(120deg, #0f1c18 0%, #13241f 55%, #1e3a31 100%);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(234, 167, 46, 0.25);
}
.welcome-body { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: var(--s-2); min-width: 0; }
.welcome-eyebrow { font-size: 12px; font-weight: 700; color: var(--gold-light); letter-spacing: 0.02em; }
.welcome-title { font-size: 28px; font-weight: 800; color: #fff; line-height: 1.3; }
.welcome-line { color: var(--navy-text); font-size: 14px; }
.welcome-stats { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-1); }
.welcome-pill {
  display: inline-flex; align-items: center; gap: 6px; min-block-size: 30px; padding: 0 var(--s-3);
  border-radius: var(--r-full); font-size: 12.5px; font-weight: 600; color: var(--navy-text);
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14);
}
.welcome-pill b { color: #fff; font-weight: 800; font-size: 14px; }
.welcome-pill.is-link { background: var(--gold); color: var(--gold-ink); border-color: transparent; font-weight: 700; text-decoration: none; }
.welcome-pill.is-link:hover { background: var(--gold-light); text-decoration: none; }
.welcome-visual { position: relative; z-index: 1; inline-size: 150px; align-self: stretch; }
.welcome-arch { position: absolute; inset-block-end: calc(var(--s-5) * -1); inset-inline-end: 0; --arch-h: calc(100% + var(--s-5) + 8px); }
.welcome-scene { display: none; }
.welcome-close { position: absolute; inset-block-start: var(--s-2); inset-inline-end: var(--s-2); z-index: 3; color: var(--navy-text); }
.welcome-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* مشهد المكتب: صورة عريضة على الجهة المقابلة للنص، تتلاشى حافتها نحو لون اللافتة */
.welcome.has-scene { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 0 var(--s-6); }
.welcome.has-scene .welcome-arch { display: none; }
.welcome.has-scene .welcome-body { padding-block: var(--s-5); }
.welcome.has-scene .welcome-visual { inline-size: auto; }
.welcome.has-scene .welcome-scene {
  display: block; position: absolute; inset-block: 0; inset-inline-end: 0; inline-size: 100%; block-size: 100%;
  object-fit: cover; object-position: 30% 35%;
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 40%); mask-image: linear-gradient(to left, transparent 0, #000 40%);
}

@media (max-width: 720px) {
  .welcome, .welcome.has-scene { grid-template-columns: minmax(0, 1fr); min-block-size: 0; padding: var(--s-4); gap: var(--s-3); }
  .welcome .welcome-visual { display: none; }
  .welcome.has-scene .welcome-body { padding-block: 0; }
  .welcome-title { font-size: 20px; }
  .welcome-line { font-size: 13px; }
  .welcome-body { padding-inline-end: var(--s-6); }
}

/* ==========================================================================
   بطاقة الإرشاد (آخر نظرة عامة)
   ========================================================================== */
.advise-card {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: stretch;
  overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
}
.advise-img { inline-size: 100%; block-size: 100%; min-block-size: 200px; max-block-size: 260px; object-fit: cover; object-position: 60% 40%; }
.advise-body { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: var(--s-3); padding: var(--s-5) var(--s-6); }
.advise-body h3 { font-size: 18px; color: var(--primary-700); }
.advise-body p { color: var(--text-2); font-size: 13.5px; max-inline-size: 440px; }
@media (max-width: 720px) {
  .advise-card { grid-template-columns: minmax(0, 1fr); }
  .advise-img { max-block-size: 170px; min-block-size: 0; }
  .advise-body { padding: var(--s-4); }
}

/* ==========================================================================
   رسوم الحالات الفارغة (empty-*.webp)
   ========================================================================== */
.empty.has-art { padding-block: var(--s-6); }
.empty-art { inline-size: 160px; block-size: 160px; object-fit: contain; margin-bottom: var(--s-1); }

/* ==========================================================================
   ضبط للشاشات الصغيرة وكثافة الجداول
   ========================================================================== */
.table th, .table td { padding-inline: 12px; }
@media (max-width: 640px) {
  .date-range, .date-range-inputs { inline-size: 100%; }
  .date-range-inputs > span[data-slot] { flex: 1 1 0; min-width: 0; }
  .date-range-inputs .pk { inline-size: 100%; }
}
