:root {
  --bg: #f3f6f4;
  --bg-deep: #e7eee9;
  --ink: #15231c;
  --muted: #5b6b62;
  --line: #cfdad3;
  --panel: #ffffff;
  --brand: #0f6b4c;
  --brand-dark: #0a4d37;
  --accent: #c45c26;
  --accent-soft: #f7ebe3;
  --blue: #1f5f8b;
  --red: #b33b3b;
  --orange: #c7781a;
  --ok: #1f7a4d;
  --warn: #9a6b12;
  --shadow: 0 18px 40px rgba(21, 35, 28, 0.08);
  --radius: 18px;
  --font-display: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(15, 107, 76, 0.08), transparent 35%),
    radial-gradient(circle at 90% 0%, rgba(196, 92, 38, 0.08), transparent 30%),
    linear-gradient(160deg, var(--bg), var(--bg-deep));
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #12382c 0%, #0d2a21 100%);
  color: #e8f2ec;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brand strong {
  font-size: 1.55rem;
  letter-spacing: 0.02em;
}
.brand span {
  color: #9bb8ab;
  font-size: 0.85rem;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.nav-links a {
  padding: 12px 14px;
  border-radius: 12px;
  color: #d7e7de;
  transition: 0.2s ease;
}
.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-user {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #b7cec3;
  font-size: 0.92rem;
}

.main {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.topbar h1 {
  margin: 0;
  font-size: 1.7rem;
  font-family: var(--font-display);
}
.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stat-card, .action-card {
  border-radius: 16px;
  padding: 22px;
  color: #fff;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover, .action-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(0,0,0,0.12);
}
.stat-card h3, .action-card h3 {
  margin: 0;
  font-size: 1.25rem;
}
.stat-card span, .action-card span {
  opacity: 0.9;
  font-size: 0.92rem;
}
.bg-blue { background: linear-gradient(135deg, #1f5f8b, #2d7db0); }
.bg-red { background: linear-gradient(135deg, #b33b3b, #d45a5a); }
.bg-orange { background: linear-gradient(135deg, #c7781a, #e0963d); }
.bg-green { background: linear-gradient(135deg, #0f6b4c, #1d8a64); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 11px 18px;
  font: inherit;
  cursor: pointer;
  transition: 0.2s ease;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary {
  background: #e8efea;
  color: var(--ink);
}
.btn-danger {
  background: var(--red);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-sm { padding: 7px 12px; font-size: 0.88rem; border-radius: 10px; }

.input, select.input, textarea.input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfcfb;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
}
.input:focus {
  outline: 2px solid rgba(15, 107, 76, 0.25);
  border-color: var(--brand);
}
.form-grid {
  display: grid;
  gap: 14px;
}
.form-row {
  display: grid;
  gap: 8px;
}
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
label { font-weight: 600; color: #314339; }
.helptext, .errorlist {
  color: var(--red);
  font-size: 0.86rem;
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}
.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-ok { background: #e5f6ec; color: var(--ok); }
.badge-off { background: #f3e8e8; color: var(--red); }
.badge-soft { background: var(--accent-soft); color: var(--accent); }

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.msg {
  padding: 12px 14px;
  border-radius: 12px;
  background: #e8f5ee;
  color: var(--ok);
  border: 1px solid #cfe8da;
}
.msg.error, .msg-error {
  background: #fbeeee;
  color: var(--red);
  border-color: #f0d0d0;
}
.msg.warning {
  background: #fff7e8;
  color: var(--warn);
  border-color: #f0e0b8;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
.auth-visual {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(15,107,76,0.92), rgba(18,56,44,0.95)),
    url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.08'%3E%3Cpath d='M0 80h160M80 0v160'/%3E%3Ccircle cx='80' cy='80' r='40'/%3E%3C/g%3E%3C/svg%3E");
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.auth-visual h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin: 0 0 12px;
  line-height: 1.15;
}
.auth-visual p {
  max-width: 34rem;
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.88);
}
.auth-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
}
.auth-card .panel {
  width: min(460px, 100%);
}
.auth-card h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}
.auth-card .subtitle {
  color: var(--muted);
  margin-bottom: 22px;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  background: #fcfdfc;
}
.question-card h4 { margin: 0 0 12px; }
.options {
  display: grid;
  gap: 8px;
}
.options label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #f5f8f6;
  cursor: pointer;
}
.options label:hover { border-color: #bfd2c7; }

.footer-note {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.empty {
  color: var(--muted);
  padding: 18px 0;
}

/* Portfolio explain guides — primary content for reviewers */
.explain-panel {
  position: relative;
  margin-bottom: 22px;
  padding: 22px 24px;
  border-radius: 20px;
  border: 1px solid #d7e4db;
  background:
    linear-gradient(135deg, rgba(15, 107, 76, 0.06), rgba(196, 92, 38, 0.05)),
    #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.explain-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}
.explain-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.explain-panel h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  line-height: 1.4;
}
.explain-lead {
  margin: 0 0 14px;
  color: #3d4f45;
  line-height: 1.85;
  font-size: 1.02rem;
}
.explain-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}
.explain-steps {
  margin: 0;
  padding: 0 0 0 18px;
  color: #314339;
  line-height: 1.85;
}
.explain-steps li { margin-bottom: 4px; }
.explain-aside {
  background: #f4f8f5;
  border: 1px solid #d9e6de;
  border-radius: 14px;
  padding: 14px 16px;
}
.explain-aside strong {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-dark);
}
.explain-aside p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.95rem;
}
.explain-en {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #d0ddd5;
  color: #5a6c62;
  font-size: 0.92rem;
  line-height: 1.7;
  direction: ltr;
  text-align: left;
}

.nav-section-label {
  margin: 10px 4px 4px;
  font-size: 0.72rem;
  color: #7f9a8c;
  letter-spacing: 0.06em;
}

.check-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
}
.check-list label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid transparent;
}
.check-list label:hover { border-color: #c9d9cf; }

.admin-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.overview-page {
  min-height: 100vh;
  padding: 40px 20px 60px;
}
.overview-wrap {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}
.overview-hero {
  padding: 36px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(145deg, rgba(15,107,76,0.95), rgba(18,56,44,0.96));
  box-shadow: var(--shadow);
}
.overview-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
}
.overview-hero p {
  margin: 0;
  max-width: 46rem;
  line-height: 1.85;
  color: rgba(255,255,255,0.9);
}
.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.flow-step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.flow-step b {
  display: block;
  margin-bottom: 8px;
  color: var(--brand);
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
  }
  .grid-3, .grid-2, .auth-page, .explain-grid, .admin-actions, .flow-steps { grid-template-columns: 1fr; }
  .auth-visual { min-height: 280px; padding: 32px; }
  .main { padding: 18px; }
}
