* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

:root {
  --green-950: #0C1917;
  --green-900: #132420;
  --green-800: #1B362F;
  --green-700: #22453E;
  --green-600: #2B524C;
  --green-500: #3C6A63;
  --green-400: #5A837B;
  --green-300: #8AAAA3;
  --green-200: #C4D8D3;
  --green-100: #E4ECEA;
  --green-50: #F2F6F5;
  --gold-500: #C2A878;
  --gold-400: #D0B990;
  --gold-300: #E8DFCC;
  --ivory: #F8F5EE;
  --ivory-2: #E7E0D2;
  --ink: #28332F;
  --ink-soft: #576662;
  --danger: #C1553F;
  --ok: #2E8A62;
  --soft-dark: #C4D6D2;
  --cream: #F3EBDD;
  --gold-deep: #8F7448;

  --topbar-a: #111E1C;
  --topbar-b: #0B1614;
  --font-body: "Tajawal";
  --font-heading: "Tajawal";

  --primary: var(--green-600);
  --primary-dark: var(--green-900);
  --primary-light: var(--green-100);
  --gold: var(--gold-500);
  --gold-light: var(--gold-300);
  --bg: var(--ivory);
  --card: #ffffff;
  --text: var(--ink);
  --muted: var(--ink-soft);
  --border: var(--ivory-2);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  --shadow: 0 8px 24px rgba(23, 54, 51, 0.08);
  --ring: 0 0 0 3px rgba(43, 82, 76, 0.35);
}

html {
  direction: rtl;
}

body {
  font-family: var(--font-body, "Tajawal"), "Segoe UI", "Tahoma", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  font-family: var(--font-heading, "Tajawal"), var(--font-body, "Tajawal"), sans-serif;
  font-weight: 600;
  color: var(--green-900);
}

a {
  color: inherit;
  text-decoration: none;
}

.no-select {
  -webkit-user-select: none;
  user-select: none;
}

header {
  position: fixed;
  top: 8px;
  left: 50%;
  z-index: 60;
  width: min(800px, calc(100% - 28px));
  margin: 0;
  transform: translate(-50%, 0);
  background: linear-gradient(180deg, var(--topbar-a, var(--green-900)) 0%, var(--topbar-b, var(--green-700)) 100%);
  color: var(--ivory);
  border: none;
  border-radius: 999px;
  padding: 0;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.35s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

header.is-hidden {
  transform: translate(-50%, calc(-100% - 26px));
  opacity: 0;
  pointer-events: none;
}

body:not(.front-page) main {
  padding-top: 6rem;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand .logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  border: 2px solid var(--green-600);
  flex-shrink: 0;
}

.brand .logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.brand h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ivory);
  line-height: 1.35;
  margin: 0;
}

.brand p {
  font-size: 12px;
  color: var(--green-200);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.97);
}

.btn-light {
  background: #fff;
  color: var(--green-900);
}

.btn-light:hover {
  background: var(--green-100);
  color: var(--green-950);
}

.btn-outline-light {
  background: transparent;
  color: var(--ivory);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--green-200);
  color: var(--green-100);
}

.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--green-600);
  color: #fff;
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  height: 100%;
  width: 40%;
  left: -60%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
  pointer-events: none;
}

.btn-primary:hover::after {
  left: 130%;
}

.btn-primary:hover {
  background: var(--green-800);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(11, 31, 30, 0.3);
}

.btn-gold {
  background: var(--green-600);
  color: #fff;
}

.btn-gold:hover {
  filter: brightness(1.15);
}

.btn-danger {
  background: rgba(164, 69, 47, 0.1);
  color: var(--danger);
  border: 1px solid rgba(164, 69, 47, 0.25);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--green-900);
  border: 1.5px solid var(--green-300);
}

.btn-ghost:hover {
  background: var(--ivory-2);
}

main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.page-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 22px;
}

.card {
  background: var(--card);
  border: 1px solid var(--ivory-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

footer {
  background: var(--green-900);
  color: var(--soft-dark);
  text-align: center;
  padding: 16px 20px;
  font-size: 13px;
  margin-top: 3rem;
  border-top: 3px solid var(--green-700);
}

footer b {
  color: var(--green-200);
}

.notice {
  background: var(--green-100);
  border: 1px solid var(--green-300);
  color: var(--green-800);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 18px;
}

.topbar {
  background: #000;
  color: var(--ivory);
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: none;
  border-radius: 0 0 14px 14px;
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-heading, "Tajawal"), sans-serif;
  font-size: 1.05rem;
}

.topbar .brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: transparent;
  border-radius: 50%;
  padding: 3px;
}

.hero {
  position: relative;
  background: linear-gradient(180deg, var(--green-600) 0%, var(--green-500) 100%);
  color: var(--ink);
  text-align: center;
  padding: 3rem 1.25rem 3.8rem;
  overflow: hidden;
}

.hero-text {
  position: relative;
  z-index: 1;
}

.login-hero {
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.6rem, 4.5vw, 2.5rem);
  letter-spacing: 0.01em;
}

.hero .sub {
  color: var(--green-100);
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  margin-top: 0.3rem;
}

.hero .tagline {
  max-width: 640px;
  margin: 0.6rem auto 0;
  color: var(--green-100);
  font-size: 0.98rem;
}

.front-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.section {
  padding: 2.5rem 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}

.sec-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  color: #000;
  font-size: 1.05rem;
  font-weight: 700;
  box-shadow: 0 5px 14px rgba(11, 31, 30, 0.3);
}

.section-title h2 {
  font-size: 1.5rem;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--green-300), transparent);
}

.cards-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.front-content .card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--ivory-2);
  border-top: 3px solid transparent;
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.front-content .card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-600), var(--green-400));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.front-content .card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 34px rgba(11, 31, 30, 0.16);
  border-color: var(--green-300);
}

.front-content .card:hover::before {
  opacity: 1;
}

.front-content .card h3 {
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
  color: var(--green-900);
}

.front-content .card p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.8;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.hero h1, .hero .sub, .hero .tagline, .login-card {
  animation: rise 0.7s ease both;
}

.hero .sub { animation-delay: 0.1s; }
.hero .tagline { animation-delay: 0.18s; }
.login-card { animation-delay: 0.26s; }

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 410px;
  margin-top: 60px;
  background: #fff;
  border: 1px solid var(--ivory-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 66px 28px 26px;
  text-align: center;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--green-600);
}

.login-card .logo {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  margin: 0;
  overflow: hidden;
  border: 2px solid var(--green-600);
  box-shadow: 0 8px 20px rgba(23, 54, 51, 0.12);
}

.login-card .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-card h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--green-900);
  line-height: 1.35;
  margin-bottom: 4px;
}

.login-card .sub {
  color: var(--green-700);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.login-card .hint {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
}

.field {
  text-align: right;
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--green-900);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--ivory-2);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  background: var(--ivory);
  transition: border-color 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--green-600);
}

.pin-input {
  text-align: center;
  font-size: 26px !important;
  letter-spacing: 12px;
  font-weight: 700;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.search-box {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1.5px solid var(--green-300);
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  background: transparent;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.chip {
  border: 1px solid var(--green-300);
  background: var(--card);
  color: var(--green-900);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.chip:hover {
  border-color: var(--green-700);
  color: var(--green-950);
}

.chip.active {
  background: var(--green-600);
  border-color: var(--green-600);
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tile {
  position: relative;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--ivory-2);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: all 0.18s ease;
  cursor: pointer;
  overflow: hidden;
}

.tile:hover {
  transform: translateY(-5px);
  border-color: var(--green-300);
  box-shadow: 0 16px 36px rgba(11, 31, 30, 0.16);
}

.tile-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--green-950), var(--green-800));
  border-bottom: 1px solid rgba(169, 203, 201, 0.25);
}

.tile-head .head-chip {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.tile-head .head-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-100);
}

.tile-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tile-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--green-900);
  line-height: 1.5;
  font-family: "Tajawal", sans-serif;
}

.tile-body .note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.tile-body .tile-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 11px;
}

.tile .count {
  font-size: 12px;
  color: var(--muted);
}

.tile .open-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--green-900);
}

.tag-important {
  background: var(--green-600);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 11px;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}

.tile-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1.5px dashed var(--green-300);
  border-radius: var(--radius);
  padding: 40px 20px;
  font-size: 14px;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(340px, 92vw);
  background: #fff;
  border-inline-start: 1px solid var(--ivory-2);
  box-shadow: -18px 0 40px rgba(11, 31, 30, 0.18);
  z-index: 50;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  visibility: hidden;
}

.drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.drawer-head b {
  font-size: 15px;
  color: var(--green-900);
  font-family: "Tajawal", sans-serif;
}

.drawer-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.drawer-close {
  background: var(--ivory-2);
  color: var(--ink-soft);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
  transition: 0.15s;
}

.drawer-close:hover {
  background: var(--danger);
  color: #fff;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: var(--ivory);
}

.drawer .file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--ivory-2);
  border-radius: 10px;
  padding: 9px 11px;
  margin-bottom: 8px;
  transition: 0.15s;
}

.drawer .file-row:hover {
  border-color: var(--green-600);
  box-shadow: 0 4px 12px rgba(11, 31, 30, 0.08);
}

.drawer .file-row .icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer .file-info {
  flex: 1;
  min-width: 0;
}

.drawer .file-info b {
  display: block;
  font-size: 13px;
  color: var(--green-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer .file-info .f-note {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer .file-link {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green-600);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: 0.15s;
}

.drawer .file-link:hover {
  background: var(--green-800);
}

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--ivory-2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: 0.15s;
}

.file-row:hover {
  border-color: var(--green-600);
  box-shadow: 0 6px 16px rgba(11, 31, 30, 0.08);
}

.file-row .icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-row .file-info {
  flex: 1;
  min-width: 0;
}

.file-row .name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.file-row .name-row b {
  font-size: 14px;
  color: var(--green-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row .f-note {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.file-row .f-type {
  font-size: 11px;
  color: var(--green-800);
  font-weight: 700;
  background: var(--green-100);
  border: 1px solid rgba(74, 122, 119, 0.3);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}

.file-row .btn {
  padding: 9px 14px;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

.dlg-empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 10px;
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--ivory-2);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}

th {
  background: var(--green-700);
  color: #fff;
  text-align: right;
  padding: 11px 12px;
  font-weight: 600;
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ivory-2);
  vertical-align: middle;
}

tbody tr:hover td {
  background: var(--ivory);
}

.table-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.small-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.row-options {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

.row-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.files-editor {
  margin-top: 18px;
  border: 1px dashed var(--green-300);
  border-radius: 12px;
  padding: 14px;
  background: var(--ivory);
}

.files-editor h4 {
  font-size: 14px;
  color: var(--green-900);
  margin-bottom: 4px;
}

.files-editor .hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.file-input-row {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 110px auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.file-input-row input,
.file-input-row select {
  width: 100%;
  border: 1.5px solid var(--ivory-2);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}

.file-input-row input:focus,
.file-input-row select:focus {
  outline: none;
  border-color: var(--green-600);
}

.remove-file-btn {
  background: rgba(164, 69, 47, 0.1);
  color: var(--danger);
  border: none;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.remove-file-btn:hover {
  background: var(--danger);
  color: #fff;
}

.sections-manager {
  margin-top: 24px;
}

.settings-sub {
  margin: 18px 0 8px;
  font-size: 15px;
  color: var(--green-900);
  border-inline-start: 4px solid var(--green-300);
  padding-inline-start: 10px;
}

.set-card-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  margin-bottom: 10px;
}

.set-card-row input {
  width: 100%;
  border: 1.5px solid var(--ivory-2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--ivory);
  transition: border-color 0.15s;
}

.set-card-row input:focus {
  outline: none;
  border-color: var(--green-600);
}

.set-card-row .set-remove {
  border: none;
  background: rgba(164, 69, 47, 0.1);
  color: var(--danger);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
}

.set-card-row .set-remove:hover {
  background: var(--danger);
  color: #fff;
}

.front-section-edit {
  background: var(--ivory);
  border: 1px solid var(--ivory-2);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.front-sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.front-sec-head .fs-title {
  flex: 1;
  border: 1.5px solid var(--ivory-2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 700;
  color: var(--green-900);
  background: #fff;
}

.front-sec-head .fs-title:focus {
  outline: none;
  border-color: var(--green-600);
}

.front-sec-head .fs-del {
  border: 1px solid rgba(164, 69, 47, 0.35);
  background: #fff;
  color: var(--danger);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.front-sec-head .fs-del:hover {
  background: var(--danger);
  color: #fff;
}

.fs-add-card {
  border: 1px solid var(--green-300);
  background: #fff;
  color: var(--green-900);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  font-family: inherit;
}

.fs-add-card:hover {
  background: var(--ivory-2);
}

.pv-label {
  background: var(--green-600);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
}

.pv-hero {
  background:
    radial-gradient(800px 400px at 50% -10%, rgba(74, 122, 119, 0.18), transparent 60%),
    linear-gradient(160deg, var(--green-950) 0%, var(--green-800) 100%);
  color: var(--ivory);
  text-align: center;
  padding: 1.6rem 1rem;
}

.pv-hero h1 {
  color: #fff;
  font-size: 1.5rem;
}

.pv-hero .sub {
  color: var(--green-100);
  font-size: 1rem;
  margin-top: 0.2rem;
}

.pv-hero .tagline {
  color: var(--soft-dark);
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

@media (max-width: 720px) {
  .set-card-row {
    grid-template-columns: 1fr;
  }
}

.section-add {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.section-add input {
  flex: 1;
  border: 1.5px solid var(--ivory-2);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
  font-family: inherit;
}

.section-add input:focus {
  outline: none;
  border-color: var(--green-600);
}

.section-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--ivory-2);
}

.section-row input {
  flex: 1;
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  background: transparent;
  color: var(--ink);
}

.section-row input:focus {
  outline: none;
  border-color: var(--green-600);
  background: var(--ivory);
}

.section-row .sec-count {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 60px;
}

.section-row .save-sec {
  background: var(--primary-light);
  color: var(--green-900);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.section-row .save-sec:hover {
  background: var(--green-700);
  color: #000;
}

.section-row .del-sec {
  background: rgba(164, 69, 47, 0.1);
  color: var(--danger);
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.section-row .del-sec:hover {
  background: var(--danger);
  color: #fff;
}

@media (max-width: 960px) {
  .login-hero {
    min-height: 60vh;
  }
}

@media (max-width: 480px) {
  .drawer {
    width: 100vw;
    box-shadow: none;
  }
  .login-hero {
    min-height: 64vh;
    padding-top: 1.8rem;
  }
}

@media (max-width: 720px) {
  .file-input-row {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .brand h1 {
    font-size: 17px;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .login-card h2 {
    font-size: 20px;
  }
}

/* ---------- إدارة الأخبار ---------- */
.news-img-preview {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.news-img-thumb {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--green-300);
  box-shadow: var(--shadow);
  background: var(--ivory);
  display: block;
}

.news-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-img-thumb .news-img-remove {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  border: none;
  background: rgba(164, 69, 47, 0.92);
  color: #fff;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.news-img-thumb .news-img-remove:hover {
  background: var(--danger);
}

.news-admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-admin-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--ivory-2);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.news-admin-item:hover {
  transform: translateY(-2px);
  border-color: var(--green-300);
}

.news-admin-thumb {
  width: 90px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid var(--ivory-2);
}

.news-admin-thumb.none {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
  background: var(--ivory);
  border: 1.5px dashed var(--green-300);
}

.news-admin-thumb-wrap {
  position: relative;
  flex-shrink: 0;
  display: inline-block;
}

.news-admin-count {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: var(--green-600);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.4;
}

.news-admin-info {
  flex: 1;
  min-width: 0;
}

.news-admin-info b {
  font-size: 14.5px;
  color: var(--green-900);
  display: block;
}

.news-admin-date {
  display: block;
  font-size: 12px;
  color: var(--green-700);
  font-weight: 700;
  margin-top: 2px;
}

.news-admin-info p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-admin-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .news-admin-item {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .news-admin-thumb {
    width: 100%;
    height: 140px;
  }
  .news-admin-actions {
    justify-content: center;
  }
}
