@font-face {
  font-family: "IRANSans";
  src: url("assets/fonts/iransans.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #17212f;
  --muted: #667085;
  --line: #d7dde6;
  --paper: #f5f7fb;
  --panel: #ffffff;
  --navy: #12355b;
  --teal: #047c75;
  --gold: #b8872f;
  --red: #b42318;
  --green: #16724b;
  --shadow: 0 18px 44px rgba(18, 35, 58, .13);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IRANSans", Tahoma, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(18, 53, 91, .95), rgba(4, 124, 117, .84)),
    radial-gradient(circle at 25% 15%, rgba(184, 135, 47, .28), transparent 34%),
    #10233a;
}

.login-shell {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1fr .85fr;
  gap: 24px;
  align-items: stretch;
}

.login-panel, .login-info {
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 34px;
}

.national-mark {
  width: 76px;
  height: 76px;
  border: 2px solid rgba(184, 135, 47, .55);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
  position: relative;
}

.mark-ring {
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(18, 53, 91, .55);
  border-radius: 50%;
}

.mark-core {
  font-weight: 900;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.35; margin-bottom: 14px; }
h2 { font-size: 25px; margin-bottom: 0; }
h3 { font-size: 20px; margin-bottom: 16px; }
.lead { color: #475467; line-height: 2; margin-bottom: 26px; }

.ownership {
  display: inline-flex;
  margin: -8px 0 22px;
  padding: 8px 12px;
  border: 1px solid #d8e6ea;
  border-radius: 8px;
  background: #f4faf9;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.login-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.login-form label:first-child, .login-form button { grid-column: 1 / -1; }
label { display: grid; gap: 8px; color: #344054; font-size: 13px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(4, 124, 117, .12); }

.primary-button, .ghost-button, .danger-button, .icon-button {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 16px;
  font-weight: 800;
}

.primary-button { background: var(--teal); color: #fff; }
.ghost-button { background: #eef4f7; color: var(--navy); border: 1px solid #d5e3ea; }
.danger-button { background: #fff1f0; color: var(--red); border: 1px solid #ffd1cc; }
.icon-button { width: 38px; padding: 0; background: #eef2f6; color: var(--ink); font-size: 24px; }

.login-info {
  display: grid;
  align-content: center;
  gap: 18px;
}

.status-card {
  background: #102f4f;
  color: #fff;
  border-radius: 8px;
  padding: 22px;
  display: grid;
  gap: 8px;
}

.status-card span, .status-card small { color: rgba(255,255,255,.76); }
.status-card strong { font-size: 34px; }

.login-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.login-grid div {
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 8px;
}

.login-grid b { font-size: 24px; color: var(--navy); }
.login-grid span { color: var(--muted); font-size: 13px; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 284px 1fr;
}

.sidebar {
  background: #0f2945;
  color: #fff;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 22px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.brand-seal {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--navy);
  font-weight: 900;
}

.brand span, .sidebar-footer span { display: block; color: rgba(255,255,255,.7); font-size: 12px; margin-top: 4px; }

.nav { padding: 12px; overflow: auto; }
.nav button {
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.82);
  border-radius: 8px;
  padding: 12px 13px;
  text-align: right;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.nav button.active, .nav button:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav small { color: rgba(255,255,255,.55); }

.sidebar-footer {
  padding: 18px 22px;
  border-top: 1px solid rgba(255,255,255,.12);
}

.workspace { min-width: 0; }
.topbar {
  min-height: 86px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.content { padding: 24px; display: grid; gap: 20px; }

.hero-band, .panel, .table-panel, .detail-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .06);
}

.hero-band {
  padding: 24px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: center;
  border-top: 4px solid var(--gold);
}

.hero-band p { color: var(--muted); line-height: 1.9; margin-bottom: 0; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.badge { background: #eef7f6; color: var(--teal); border: 1px solid #c9e7e4; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.badge.warn { background: #fff8e8; color: #946200; border-color: #f5d78c; }
.badge.danger { background: #fff1f0; color: var(--red); border-color: #ffd1cc; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-height: 118px;
}

.metric-card span { color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; margin: 10px 0 8px; font-size: 28px; color: var(--navy); direction: ltr; text-align: right; }
.metric-card small { color: var(--green); font-weight: 800; }

.grid-2 { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.inquiry-layout { display: grid; grid-template-columns: 1fr 330px; gap: 18px; align-items: start; }
.panel, .detail-panel { padding: 20px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-title p { margin: 0; color: var(--muted); font-size: 13px; }

.chart {
  height: 220px;
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 12px 0 0;
}

.bar {
  flex: 1;
  min-width: 22px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, #0a8f86, #12355b);
  position: relative;
}

.bar span {
  position: absolute;
  bottom: -28px;
  right: 50%;
  transform: translateX(50%);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.progress-list { display: grid; gap: 14px; }
.progress-item { display: grid; gap: 8px; }
.progress-meta { display: flex; justify-content: space-between; color: #344054; font-size: 13px; font-weight: 800; }
.progress-track { height: 9px; background: #edf1f5; border-radius: 999px; overflow: hidden; }
.progress-track i { display: block; height: 100%; background: var(--teal); border-radius: inherit; }

.table-panel { overflow: hidden; }
.table-toolbar { padding: 16px; display: flex; justify-content: space-between; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.table-toolbar input { max-width: 320px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 13px 16px; border-bottom: 1px solid #edf0f4; text-align: right; font-size: 13px; vertical-align: middle; }
th { color: #475467; background: #f8fafc; font-weight: 900; }
td { color: #1f2937; }
tr:hover td { background: #fbfdff; }

.status { display: inline-flex; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 900; }
.status.ok { background: #eaf7f1; color: var(--green); }
.status.pending { background: #fff8e8; color: #946200; }
.status.bad { background: #fff1f0; color: var(--red); }
.link-button { border: 0; background: transparent; color: var(--teal); font-weight: 900; padding: 0; }

.subsystem-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.subsystem-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 12px;
  min-height: 178px;
}

.subsystem-card strong { font-size: 17px; color: var(--navy); }
.subsystem-card p { color: var(--muted); line-height: 1.8; margin: 0; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.checklist { display: grid; gap: 10px; }
.checklist label { display: flex; gap: 10px; align-items: center; background: #f8fafc; padding: 12px; border: 1px solid #edf0f4; border-radius: 8px; font-weight: 700; }
.checklist input { width: auto; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, .55);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-card {
  width: min(720px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
}

.modal-card .icon-button { position: absolute; left: 18px; top: 18px; }
.result-card { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #f8fafc; display: grid; gap: 10px; margin-top: 14px; }

.qr-panel {
  display: grid;
  gap: 14px;
}

.qr-card, .mini-ledger, .certificate {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.qr-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.qr-card canvas {
  width: 220px;
  height: 220px;
  border: 10px solid #f3f6f9;
  border-radius: 8px;
}

.qr-card strong {
  direction: ltr;
  color: var(--navy);
  font-size: 15px;
}

.qr-card span { color: var(--muted); font-size: 13px; }

.mini-ledger {
  display: grid;
  gap: 10px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #edf0f4;
  border-radius: 8px;
}

.timeline-row i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e7f4f2;
  color: var(--teal);
  font-style: normal;
  font-weight: 900;
}

.timeline-row b {
  color: var(--green);
  font-size: 12px;
}

.certificate {
  margin-top: 16px;
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.certificate-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid #edf0f4;
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.certificate-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 18px;
  line-height: 1.9;
}

.certificate-grid span {
  background: #f8fafc;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  padding: 9px 11px;
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; min-height: auto; }
  .nav { display: flex; overflow-x: auto; }
  .nav button { min-width: 190px; }
  .sidebar-footer { display: none; }
  .hero-band, .grid-2, .login-shell, .inquiry-layout { grid-template-columns: 1fr; }
  .metrics-grid, .subsystem-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .login-screen, .content { padding: 16px; }
  .login-panel, .login-info, .hero-band, .panel { padding: 18px; }
  .login-form, .metrics-grid, .subsystem-grid, .grid-3, .form-grid, .certificate-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .table-panel { overflow-x: auto; }
  table { min-width: 760px; }
}
