
  :root {
    --green: #2ecc71;
    --green-dark: #1a9e54;
    --green-deeper: #157a40;
    --green-light: #e8f8f0;
    --green-mid: #c3efda;
    --text: #1a2e23;
    --text-muted: #7a9a87;
    --border: #d0e8db;
    --white: #ffffff;
    --bg: #f4faf7;
    --shadow: 0 2px 16px rgba(46,204,113,0.10);
    --radius: 12px;
    --radius-sm: 8px;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    direction: rtl;
  }

/* ─── HEADER ─── */
.header {
  /* ✅ اللون الأخضر كخلفية أساسية */
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 60%, #5de89d 100%);
  
  padding: 40px 40px 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ✅ الصورة كطبقة إضافية فوق الأخضر (اختيارية) */
.header::before {
  content: '';
  position: absolute;
  inset: 0;
  /* ضع مسار صورتك هنا - إذا لم توجد صورة، سيظهر الأخضر فقط */
  background-image: url('http://localhost:8080/nshat/your-image.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.80; /* شفافية منخفضة عشان الأخضر يظهر تحتها */
  z-index: 1;
  /* يمكنك حذف هذا السطر أو تعليقه إذا لم تريد الصورة */
  /* display: none;  <-- احذف التعليق لإخفاء الصورة */
}


/* ✅ إزالة أي طبقة لونية أخرى */
/* لا تضف ::after نهائياً */

/* محتوى الهيدر */
.header-content {
  position: relative;
  z-index: 2; /* فوق الصورة */
  width: 100%;
}

.header-logo {
  width: 90px;
  height: 90px;
  background: rgba(255,255,255,0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 10px 35px rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
  overflow: hidden;
}

.header-logo img {
  width: 70%;
  height: auto;
  object-fit: contain;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.header-org {
  font-size: 15px;
  color: rgba(255,255,255,0.95);
  font-weight: 600;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.header-title {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  margin: 12px 0 16px;
  text-shadow: 0 3px 12px rgba(0,0,0,0.2);
  letter-spacing: -0.5px;
}

.credits {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.credits span {
  background: rgba(255,255,255,0.15);
  padding: 5px 14px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

  /* ─── FORM WRAPPER ─── */
  .form-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 32px 20px 60px;
  }

  /* ─── CARD ─── */
  .card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 32px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
  }
  .card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--green-dark);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--green-mid);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .card-title::before {
    content: '';
    display: inline-block;
    width: 4px; height: 18px;
    background: var(--green);
    border-radius: 4px;
  }

  /* ─── GRID ─── */
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
  .span-2 { grid-column: span 2; }

  /* ─── FIELD ─── */
  .field { display: flex; flex-direction: column; gap: 6px; }
  .field label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .field label .req { color: #e74c3c; font-size: 15px; }

  input[type="text"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    appearance: none;
    direction: rtl;
  }
  input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(46,204,113,0.15);
  }
  textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
  select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232ecc71' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 32px;
  }
  ::placeholder { color: var(--text-muted); font-weight: 300; }

  /* ─── PHOTO GRID ─── */
  .photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .photo-box {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
    overflow: hidden;
    position: relative;
  }
  .photo-box:hover { border-color: var(--green); background: var(--green-light); }
  .photo-box input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
  .photo-box .ph-icon { font-size: 28px; margin-bottom: 6px; }
  .photo-box .ph-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
  .photo-box img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
  .photo-box .remove-photo {
    position: absolute; top: 6px; left: 6px;
    background: rgba(231,76,60,0.85);
    color: #fff; border: none; border-radius: 50%;
    width: 24px; height: 24px; cursor: pointer;
    font-size: 14px; display: none;
    align-items: center; justify-content: center;
    z-index: 10;
  }
  .photo-box:hover .remove-photo { display: flex; }

  /* ─── SIGNATURE SECTION ─── */
  .sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
  .sig-box {
    background: var(--green-light);
    border: 1.5px solid var(--green-mid);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    text-align: center;
  }
  .sig-box .sig-role { font-size: 12px; font-weight: 700; color: var(--green-dark); margin-bottom: 6px; letter-spacing: 0.5px; }
  .sig-box .sig-name { font-size: 16px; font-weight: 800; color: var(--text); }

  /* ─── ACTIONS ─── */
  .actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 28px;
  }
  .btn {
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    font-weight: 700;
    padding: 13px 28px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; gap: 8px;
  }
  .btn-primary {
    background: linear-gradient(135deg, var(--green-dark), var(--green));
    color: #fff;
    box-shadow: 0 4px 16px rgba(46,204,113,0.35);
  }
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(46,204,113,0.45); }
  .btn-secondary {
    background: #fff;
    color: var(--green-dark);
    border: 2px solid var(--green);
  }
  .btn-secondary:hover { background: var(--green-light); }
  .btn-danger {
    background: #fff;
    color: #e74c3c;
    border: 2px solid #e74c3c;
  }
  .btn-danger:hover { background: #fdf2f0; }
  .btn-info {
    background: linear-gradient(135deg, #2980b9, #3498db);
    color: #fff;
    box-shadow: 0 4px 16px rgba(52,152,219,0.3);
  }
  .btn-info:hover { transform: translateY(-2px); }

  /* ─── TOAST ─── */
  .toast {
    position: fixed;
    bottom: 28px; right: 28px;
    background: var(--green-dark);
    color: #fff;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
    z-index: 999;
    pointer-events: none;
  }
  .toast.show { transform: translateY(0); opacity: 1; }

  /* ─── REPORTS LIST ─── */
  .reports-panel {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .reports-panel.open { display: flex; }
  .reports-modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    direction: rtl;
  }
  .reports-modal h2 { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 16px; }
  .report-item {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: default;
    transition: all 0.15s;
  }
  .report-item:hover { border-color: var(--green); background: var(--green-light); }
  .report-item .ri-info { flex: 1; }
  .report-item .ri-teacher { font-weight: 700; font-size: 14px; direction:ltr; text-align:right; }
  .report-item .ri-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
  .report-item .ri-actions { display: flex; gap: 8px; }
  .ri-btn {
    font-family: 'Tajawal', sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
  }
  .ri-btn-load { background: var(--green-light); color: var(--green-dark); }
  .no-reports { text-align: center; padding: 32px; color: var(--text-muted); font-size: 15px; }

  /* =========================
     PRINT SHEET BASE
     ========================= */
  .print-only { display:none; }
  .ps-page{
    width: 210mm;
    min-height: 297mm;
    background:#fff;
    padding: 12mm 12mm 10mm;
    margin: 0 auto;
    color:#111;
  }
  .ps-header{
    border: 2px solid #0b7a5b;
    border-radius: 12px;
    padding: 10px 12px;
    display:flex;
    gap:12px;
    align-items:center;
    justify-content:space-between;
  }
  .ps-brand{display:flex; gap:10px; align-items:center}
  .ps-logo{
    width:44px; height:44px; border-radius:50%;
    background:#0b7a5b; color:#fff;
    display:flex; align-items:center; justify-content:center;
    font-size:22px;
  }
  .ps-org{font-weight:800; font-size:13px}
  .ps-school{font-size:12px; color:#444; margin-top:2px}
  .ps-title{ text-align:left; min-width: 250px }
  .ps-doc{font-weight:900; font-size:16px}
  .ps-meta{font-size:11px; color:#333; margin-top:4px; display:flex; gap:10px; flex-wrap:wrap}

  .ps-section{
    margin-top:10px;
    border:1px solid #dfe7e3;
    border-radius:10px;
    padding:10px;
    page-break-inside: avoid;
  }
  .ps-sec-title{
    font-weight:900; font-size:12px; color:#0b7a5b;
    margin-bottom:8px; padding-bottom:6px;
    border-bottom:1px dashed #cfe7db;
  }
  .ps-grid2{display:grid; grid-template-columns:1fr 1fr; gap:8px}
  .ps-grid3{display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px}
  .ps-span2{grid-column: span 2;}
  .ps-field{
    border:1px solid #e5e7eb; border-radius:8px;
    padding:8px; display:flex; justify-content:space-between; gap:10px
  }
  .ps-field .k{font-size:11px; color:#555; font-weight:700}
  .ps-field .v{font-size:12px; font-weight:800; color:#111; text-align:left}

  .ps-box{
    border:1px solid #e5e7eb; border-radius:10px;
    padding:10px; min-height:38px; line-height:1.7;
    white-space:pre-wrap;
  }

  .ps-photos{display:grid; grid-template-columns:1fr 1fr; gap:8px}
  .ps-photo{
    border:1px solid #e5e7eb; border-radius:10px; overflow:hidden;
    height: 60mm; position:relative; background:#fafafa;
    page-break-inside: avoid;
  }
  .ps-photo .ph{
    position:absolute; top:6px; right:8px;
    background: rgba(11,122,91,0.9);
    color:#fff; padding:4px 8px; border-radius:999px;
    font-size:11px; font-weight:800;
    z-index:2;
  }
  .ps-photo img{ width:100%; height:100%; object-fit:cover; display:block; }

  .ps-signs{display:grid; grid-template-columns:1fr 1fr; gap:10px}
  .ps-sign{border:1px solid #e5e7eb; border-radius:10px; padding:10px}
  .ps-sign .r{font-size:11px; color:#0b7a5b; font-weight:900}
  .ps-sign .n{font-size:13px; font-weight:900; margin-top:6px}
  .ps-sign .l{font-size:11px; margin-top:14px; color:#333}

  .ps-footer{
    margin-top:10px;
    border-top:1px solid #e5e7eb;
    padding-top:8px;
    display:flex; justify-content:space-between; gap:10px;
    font-size:10px; color:#555;
  }

  /* ─── PRINT STYLES ─── */
  @media print {
    @page { size: A4; margin: 10mm; }

    body {
      background:#fff;
      -webkit-print-color-adjust: exact;
      print-color-adjust: exact;
    }

    .no-print, .actions, .toast, .reports-panel { display:none !important; }

    /* Hide the normal UI */
    .header, .form-container { display:none !important; }

    /* Show print sheet */
    .print-only { display:block !important; }

    a[href]:after { content: "" !important; }
  }

  @media (max-width: 640px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .sig-grid { grid-template-columns: 1fr; }
    .photo-grid { grid-template-columns: 1fr 1fr; }
    .header h1 { font-size: 20px; }
  }
