/* ═══════════════════════════════════════════════════════════════
   UI VISION — تجربة «منصة الوليد»
   طبقة تصميم نهائية للواجهات التفاعلية فقط: دخول، رئيسية، إعداد الخطة،
   الشاشات المستقلة، السجل، التقييم، الإدارة، والجوال.
   لا تغيّر منطق التطبيق ولا طباعة A4.
   ═══════════════════════════════════════════════════════════════ */

@media screen {
  /* توكنز --vision-* انتقلت لملف assets/alwaleed-tokens.css — نفس القيم بلا تغيير. */

  html { scroll-behavior: smooth; }
  body {
    color: var(--vision-ink);
    background:
      radial-gradient(circle at 10% 12%, rgba(199,154,69,.12), transparent 28%),
      radial-gradient(circle at 88% 14%, rgba(8,118,107,.15), transparent 32%),
      radial-gradient(circle at 70% 88%, rgba(38,79,102,.10), transparent 34%),
      var(--vision-bg);
  }

  .aurora-bg {
    background:
      radial-gradient(900px 540px at 8% 8%, rgba(255, 232, 191, .55), transparent 62%),
      radial-gradient(760px 520px at 93% 9%, rgba(42, 157, 143, .24), transparent 60%),
      radial-gradient(720px 560px at 76% 92%, rgba(69, 123, 157, .17), transparent 62%),
      linear-gradient(145deg, #fbfaf4 0%, #eef6f2 52%, #f7f1e5 100%);
    animation: drift 28s ease-in-out infinite;
  }
  .aurora-bg::before {
    content: ""; position: absolute; inset: 0;
    background:
      linear-gradient(115deg, transparent 0 44%, rgba(255,255,255,.33) 45% 46%, transparent 47% 100%),
      radial-gradient(rgba(8,118,107,.05) 1px, transparent 1px);
    background-size: auto, 26px 26px;
    opacity: .75;
  }

  :where(button, .teacher-card, .td-option, .student-chk, .date-input, .choice-card) {
    -webkit-tap-highlight-color: transparent;
  }
  :where(button, a, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid rgba(8,118,107,.42) !important;
    outline-offset: 3px;
  }

  /* دخول فاخر وواضح */
  .auth-screen.show { display: flex; }
  .auth-card {
    max-width: 462px;
    padding: clamp(30px, 5vw, 46px);
    border-radius: 34px;
    background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.78));
    border: 1px solid rgba(255,255,255,.92);
    box-shadow: var(--vision-shadow-lg);
  }
  .auth-card::before,
  .home-card::before {
    height: 6px;
    background: linear-gradient(90deg, var(--vision-brand), #61b7aa, var(--vision-gold), var(--vision-coral));
  }
  .auth-logo img { width: clamp(118px, 28vw, 152px); filter: drop-shadow(0 12px 20px rgba(23,59,53,.10)); }
  .auth-card h1, .home-card h1, .main-head h2 { letter-spacing: -.55px; }
  .auth-card .sub {
    width: fit-content; margin: 0 auto 28px; padding: 7px 14px;
    border-radius: 999px; background: rgba(8,118,107,.09);
    -webkit-text-fill-color: currentColor; color: var(--vision-brand);
    letter-spacing: .8px;
  }
  .auth-form label { color: var(--vision-ink); font-size: 13.5px; }
  .auth-form input, .field select, .search-wrap input, .home-card-fields textarea, .home-card-fields select, .adm-card input, .adm-card select, .adm-search {
    border: 1.5px solid var(--vision-line);
    border-radius: 16px;
    background: rgba(255,255,255,.94);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
  }
  .auth-form input:focus, .field select:focus, .search-wrap input:focus, .home-card-fields textarea:focus, .home-card-fields select:focus, .adm-card input:focus, .adm-card select:focus, .adm-search:focus {
    border-color: var(--vision-brand);
    box-shadow: 0 0 0 4px rgba(8,118,107,.12), inset 0 1px 0 rgba(255,255,255,.9);
  }
  /* قواعد .cp-save و.cp-print انتقلت لملف assets/components.css */
  /* قواعد .sp-open انتقلت لملف assets/components.css */

  /* الرئيسية: بطاقات كبيرة متساوية وواضحة */
  .home-screen.show { display: flex; }
  .home-screen { padding: clamp(16px, 4vw, 34px); }
  .home-card {
    width: min(980px, 100%);
    padding: clamp(26px, 5vw, 46px);
    border-radius: 36px;
    background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.82));
    border: 1px solid rgba(255,255,255,.9);
    box-shadow: var(--vision-shadow-lg);
  }
  .home-logo img { width: clamp(116px, 22vw, 148px); }
  .home-sub { color: var(--vision-muted); margin-bottom: 28px; }
  .home-choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-width: 820px;
  }
  .choice-card {
    min-height: 182px;
    padding: 22px;
    align-items: flex-start;
    text-align: right;
    border-radius: 26px;
    border: 1px solid var(--vision-line);
    background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(248,252,250,.88));
    box-shadow: var(--vision-shadow-sm);
    position: relative;
    overflow: hidden;
  }
  .choice-card::after {
    content: ""; position: absolute; inset: auto -24px -42px auto;
    width: 118px; height: 118px; border-radius: 50%;
    background: rgba(8,118,107,.08);
  }
  .choice-card.alt::after { background: rgba(38,79,102,.09); }
  .choice-card.eval::after { background: rgba(217,117,89,.10); }
  .choice-card.reports::after { background: rgba(49,139,173,.11); }
  .choice-card.admin-data::after { background: rgba(8,118,107,.12); }
  .choice-card.codes::after { background: rgba(199,154,69,.14); }
  .choice-card.dash::after { background: rgba(24,160,147,.11); }
  .choice-card:hover { transform: translateY(-6px); border-color: var(--vision-line-strong); box-shadow: var(--vision-shadow-md); }
  .cc-ic {
    width: 58px; height: 58px; border-radius: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 28px; background: rgba(8,118,107,.10);
  }
  .choice-card.alt .cc-ic { background: rgba(38,79,102,.10); }
  .choice-card.eval .cc-ic { background: rgba(217,117,89,.12); }
  .choice-card.reports .cc-ic { background: rgba(49,139,173,.13); }
  .choice-card.admin-data .cc-ic { background: linear-gradient(135deg, rgba(8,118,107,.16), rgba(199,154,69,.10)); }
  .choice-card.codes .cc-ic { background: rgba(199,154,69,.16); }
  .choice-card.dash .cc-ic { background: rgba(24,160,147,.13); }
  .cc-title { font-size: 19px; font-weight: 900; color: var(--vision-ink); }
  .cc-desc { color: var(--vision-muted); line-height: 1.65; }
  .cc-go { margin-top: auto; padding: 7px 13px; border-radius: 999px; background: rgba(8,118,107,.09); color: var(--vision-brand); font-weight: 800; }

  @media (min-width: 761px) {
    .home-card {
      width: min(1020px, 100%);
      max-width: 1020px;
      padding: clamp(34px, 4.8vw, 50px);
    }
    .home-card h1 {
      font-size: clamp(27px, 2.6vw, 34px);
      margin-bottom: 8px;
    }
    .home-sub {
      margin-bottom: 30px;
    }
    .home-choices {
      max-width: 900px;
      gap: 18px;
    }
    .choice-card {
      display: grid;
      grid-template-columns: 62px minmax(0, 1fr) auto;
      grid-template-rows: auto auto;
      column-gap: 16px;
      row-gap: 5px;
      width: auto;
      max-width: none;
      min-height: 150px;
      height: 150px;
      padding: 24px 26px;
      align-items: center;
      justify-self: stretch;
    }
    .choice-card::after {
      inset: auto -34px -54px auto;
      width: 140px;
      height: 140px;
    }
    .cc-ic {
      grid-row: 1 / 3;
      width: 62px;
      height: 62px;
    }
    .cc-title {
      grid-column: 2;
      align-self: end;
      font-size: 20px;
      line-height: 1.25;
    }
    .cc-desc {
      grid-column: 2;
      align-self: start;
      font-size: 13.5px;
      line-height: 1.75;
    }
    .cc-go {
      grid-column: 3;
      grid-row: 1 / 3;
      margin-top: 0;
      white-space: nowrap;
      align-self: center;
    }
  }

  .crumb { color: var(--vision-muted); }
  .workspace { gap: 28px; }
  .strip-row, .eval-bar, .modal, .screen-body, .lvlhelp-sheet {
    border: 1px solid var(--vision-line) !important;
    border-radius: var(--vision-radius) !important;
    background: var(--vision-surface) !important;
    box-shadow: var(--vision-shadow-sm) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  /* .ctl-card انتقل لملف assets/components.css */
  /* .ctl-h و.step-dot انتقلتا لملف assets/components.css */
  /* .step-card.filled و.step-dot انتقلتا لملف assets/components.css */

  .end-chip, .chip-btn, .sc-opt, .ptarget, .eval-btn {
    border-radius: 16px !important;
  }
  /* .teacher-card انتقلت لملف assets/components.css */
  .tc-av { border-radius: 14px; background: linear-gradient(135deg, var(--vision-brand), var(--vision-brand-2)); }
  .field label, .date-block-label { color: var(--vision-muted); }
  .strip-row { gap: 12px; padding: 16px; }

  /* .lv-btn وكل حالاتها انتقلت لملف assets/components.css */
  .students-list { gap: 10px; }
  /* .student-chk انتقلت لملف assets/components.css */

  .preview-col { scrollbar-width: thin; }
  /* .preview-target و.style-chooser انتقلتا لملف assets/components.css */
  .preview-wrap {
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(255,255,255,.50), rgba(8,118,107,.05));
  }
  .sc-opt, .ptarget {
    min-height: 38px; padding: 8px 14px;
    border: 1px solid var(--vision-line);
    background: rgba(255,255,255,.90);
  }
  .sc-opt.active, .ptarget.active { background: rgba(8,118,107,.10); border-color: rgba(8,118,107,.28); color: var(--vision-brand); }
  /* .checkpoint و.checkpoint.ready انتقلتا لملف assets/components.css */
  /* قواعد .cp-ring/.cp-actions/.cp-save/.cp-print/.cp-hint انتقلت لملف assets/components.css */

  /* حُذفت قواعد .adm-row الميتة (لا وجود للاسم في الكود) */
  /* .lvlhelp-card انتقلت لملف assets/components.css */
  /* .td-option.selected انتقلت لملف assets/components.css */

  /* الشاشات المستقلة */
  .screen { background: rgba(243,246,242,.72); backdrop-filter: blur(10px); }
  .screen.show { display: block; }
  .screen-body {
    width: min(1040px, calc(100% - 32px));
    margin: 22px auto;
    padding: clamp(16px, 3vw, 24px);
  }
  /* .subj-grid و.subj-card وعائلتها انتقلت لملف assets/components.css */
  .eval-bar { background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(241,248,246,.88)) !important; }
  .eval-btn { min-height: 40px; background: #fff; }
  /* لمسات أدوات الإدارة انتقلت لكتلة الأساس في ui-polish.css */

  .lvlhelp-sheet { overflow: hidden; }
  .lvlhelp-head { background: linear-gradient(135deg, rgba(8,118,107,.10), rgba(199,154,69,.10)); }
  /* .lvlhelp-card انتقلت لملف assets/components.css */

  .bloom-toast {
    border-radius: 22px;
    border-color: var(--vision-line);
    box-shadow: var(--vision-shadow-md);
  }

  @media (min-width: 1024px) {
    .workspace { padding: 0 32px; }
    .steps-col { max-width: 590px; }
    .preview-col { top: 94px; }
    .level-seg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }

  @media (max-width: 1023px) {
    .main { padding-bottom: 150px; }
    .preview-col { margin-top: 10px; }
    .checkpoint-wrap {
      background: linear-gradient(to top, rgba(243,246,242,.98) 76%, rgba(243,246,242,0));
    }
  }

  @media (max-width: 760px) {
    .auth-screen, .home-screen { align-items: stretch; overflow-y: auto; }
    .auth-card, .home-card { margin: auto; border-radius: 30px; }
    .home-choices { grid-template-columns: 1fr; }
    .choice-card { min-height: 148px; }
    .cc-ic { width: 52px; height: 52px; font-size: 25px; }
    /* .subj-* (الجوال) انتقلت لملف assets/components.css */
    .panel-strip, .ctl-row, .preview-wrap { padding-left: 14px; padding-right: 14px; }
    /* .ctl-card انتقل لملف assets/components.css */
    .level-seg { grid-template-columns: 1fr; }
    /* .lv-btn (الجوال) انتقلت لملف assets/components.css */
    .lv-ava {
      justify-content: center;
      width: 100%;
    }
    .students-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    /* .date-input (الجوال) انتقل لملف assets/components.css */
    /* .checkpoint (الجوال) انتقل لملف assets/components.css */
    /* قواعد .cp-* (الجوال) انتقلت لملف assets/components.css */
    .date-summary {
      padding: 12px;
      border-radius: 18px;
      background: linear-gradient(135deg, rgba(225,246,249,.82), rgba(232,248,242,.82)) !important;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
    }
    .date-summary.show {
      display: grid;
      gap: 8px;
    }
    .date-summary .row {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      align-items: center;
      gap: 10px;
      margin: 0;
      padding: 9px 12px;
      border-radius: 14px;
      background: rgba(255,255,255,.62);
    }
    .date-summary .lbl {
      min-width: 0;
      padding: 3px 9px;
      border-radius: 999px;
      background: rgba(8,118,107,.08);
      color: var(--vision-muted);
      font-size: 12px;
      font-weight: 800;
      text-align: center;
    }
    .date-summary .val {
      color: var(--vision-ink);
      font-size: 14px;
      font-weight: 900;
      text-align: center;
      white-space: normal;
    }
    .date-summary .duration {
      margin-top: 0;
      padding-top: 8px;
      font-size: 14px;
      font-weight: 900;
      text-align: center;
      color: var(--vision-brand);
    }
  }

  @media (max-width: 420px) {
    .auth-card { padding: 26px 20px; }
    .auth-form input { min-height: 54px; font-size: 18px; letter-spacing: 6px; }
    .home-card { padding: 24px 18px; }
    .choice-card { padding: 18px; }
    .crumb { font-size: 12px; }
    /* .ctl-h و.step-dot (الجوال) انتقلتا لملف assets/components.css */
    /* .style-chooser و.preview-target (الجوال) انتقلتا لملف assets/components.css */
  }

  @media (min-width: 761px) {
    /* .date-input (سطح المكتب) انتقل لملف assets/components.css */
    .date-summary {
      margin-top: 18px;
      padding: 14px;
      border-radius: 22px;
      border-color: rgba(8,118,107,.18);
      background:
        radial-gradient(circle at 12% 20%, rgba(199,154,69,.12), transparent 30%),
        radial-gradient(circle at 88% 0%, rgba(8,118,107,.12), transparent 32%),
        linear-gradient(135deg, rgba(232,248,242,.88), rgba(225,246,249,.78)) !important;
      box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 14px 28px rgba(23,59,53,.06);
      direction: rtl;
    }
    .date-summary.show {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(170px, .72fr);
      gap: 12px;
      align-items: stretch;
    }
    .date-summary .row {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      align-items: center;
      gap: 10px;
      min-height: 64px;
      margin: 0;
      padding: 12px 14px;
      border-radius: 16px;
      border: 1px solid rgba(255,255,255,.72);
      background: rgba(255,255,255,.70);
      box-shadow: 0 8px 18px rgba(23,59,53,.04);
    }
    .date-summary .lbl {
      min-width: 0;
      padding: 5px 10px;
      border-radius: 999px;
      background: rgba(8,118,107,.09);
      color: var(--vision-muted);
      font-size: 12px;
      font-weight: 900;
      text-align: center;
    }
    .date-summary .val {
      color: var(--vision-ink);
      font-size: 15px;
      font-weight: 900;
      text-align: right;
      white-space: normal;
    }
    .date-summary .duration {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 64px;
      margin: 0;
      padding: 12px 16px;
      border: 1px solid rgba(8,118,107,.16);
      border-radius: 16px;
      background: linear-gradient(135deg, rgba(255,255,255,.74), rgba(231,248,243,.72));
      color: var(--vision-brand);
      font-size: 15px;
      font-weight: 950;
      text-align: center;
      box-shadow: 0 8px 18px rgba(23,59,53,.04);
    }
  }

  @media (min-width: 761px) and (max-width: 900px) {
    .date-summary.show {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .date-summary .duration {
      grid-column: 1 / -1;
    }
  }
}

@media print {
  /* لا تأثير لطبقة منصة الوليد على الطباعة */
}

/* ═══════════════════════════════════════════════════════════════
   تحسين تدفق إنشاء الخطة — الديسكتوب
   بناء على تجربة المستخدم: المعاينة لا تُحشر بجانب الاختيارات؛
   تظهر أسفل الخطوات بمساحة كاملة، مع ترويسة واضحة ومنطقة عرض مريحة.
   ═══════════════════════════════════════════════════════════════ */
@media screen and (min-width: 1024px) {
  .workspace {
    flex-direction: column;
    align-items: stretch;
    gap: 30px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 32px 48px;
  }

  .steps-col {
    width: min(100%, 1040px);
    max-width: none !important;
    margin: 0 auto;
  }

  .preview-col {
    position: static !important;
    top: auto !important;
    width: min(100%, 1120px);
    max-height: none !important;
    overflow: visible !important;
    margin: 0 auto;
    padding: 0 0 34px;
  }

  .preview-col::before {
    content: "المعاينة النهائية";
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin: 0 auto 14px;
    padding: 9px 18px;
    border-radius: 999px;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -.2px;
    background: linear-gradient(135deg, var(--vision-navy), var(--vision-brand));
    box-shadow: 0 14px 30px rgba(8, 79, 73, .18);
  }

  /* .preview-target و.style-chooser (سطح المكتب) انتقلتا لملف assets/components.css */

  .preview-wrap {
    width: 100%;
    min-height: 420px;
    padding: 28px 24px 10px !important;
    border-radius: 32px !important;
    background:
      radial-gradient(circle at 18% 10%, rgba(199,154,69,.13), transparent 32%),
      radial-gradient(circle at 85% 20%, rgba(8,118,107,.12), transparent 34%),
      linear-gradient(145deg, rgba(255,255,255,.78), rgba(241,248,246,.72)) !important;
  }

  .preview-wrap #preview {
    width: 100%;
  }

  .checkpoint-wrap {
    width: min(100%, 1040px);
    margin-left: auto;
    margin-right: auto;
  }

  .main {
    padding-bottom: 54px;
  }
}

@media screen and (min-width: 1280px) {
  .steps-col {
    width: min(100%, 1080px);
  }

  .preview-col {
    width: min(100%, 1180px);
  }
}
