:root {
  --navy: #071633;
  --white: #ffffff;
}

@font-face {
  font-family: IRANSansX;
  src: url("../fonts/IRANSansXFaNum-Thin.woff2") format("woff2");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: IRANSansX;
  src: url("../fonts/IRANSansXFaNum-UltraLight.woff2") format("woff2");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: IRANSansX;
  src: url("../fonts/IRANSansXFaNum-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: IRANSansX;
  src: url("../fonts/IRANSansXFaNum-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: IRANSansX;
  src: url("../fonts/IRANSansXFaNum-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: IRANSansX;
  src: url("../fonts/IRANSansXFaNum-DemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: IRANSansX;
  src: url("../fonts/IRANSansXFaNum-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: IRANSansX;
  src: url("../fonts/IRANSansXFaNum-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: IRANSansX;
  src: url("../fonts/IRANSansXFaNum-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: IRANSansX;
  src: url("../fonts/IRANSansXFaNum-ExtraBlack.woff2") format("woff2");
  font-weight: 950;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: IRANSansX;
  src: url("../fonts/IRANSansXFaNum-Heavy.woff2") format("woff2");
  font-weight: 1000;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html {
  font-family: IRANSansX, Tahoma, sans-serif;
}

html { font-size: 93.75%; }

body {
  margin: 0;
  color: var(--navy);
  background: var(--white);
  font-family: IRANSansX, Tahoma, sans-serif;
  font-weight: 400;
  line-height: 1.6;
}

a, a:visited { color: var(--navy); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.topbar {
  background: var(--navy);
  color: var(--white);
}

.bar, .page {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  gap: 16px;
}

.brand, .brand:visited {
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
}

.nav, .nav form {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav a, .nav a:visited, .who { color: var(--white); text-decoration: none; }

.who { font-weight: 600; white-space: nowrap; }

.nav a, .nav .linkish {
  border: 1px solid var(--white);
  padding: 6px 12px;
  margin: 6px 0;
}

.page { padding: 28px 0 64px; }

.heading, .split {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

h1, h2, h3 { margin: 0 0 8px; line-height: 1.3; font-weight: 700; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.1rem; }

.eyebrow {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 600;
}

.muted, .lead, .hint { color: var(--navy); font-weight: 400; }

.card {
  background: var(--white);
  border: 1px solid var(--navy);
  padding: 20px;
  margin: 16px 0;
}

.card.narrow { width: min(560px, 100%); }
.card.notice { border-width: 2px; }

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

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th, td {
  text-align: right;
  padding: 10px 8px;
  border-bottom: 1px solid var(--navy);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }

th { color: var(--navy); font-weight: 700; font-size: 0.92rem; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--navy);
  background: var(--white);
  color: var(--navy);
  font-size: 0.9rem;
}

.badge.approved {
  background: var(--navy);
  color: var(--white);
}

.button,
button.button,
a.button:visited,
a.button:hover {
  display: inline-block;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: var(--white);
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.button.secondary,
.button.danger,
button.danger,
a.button.secondary:visited,
a.button.secondary:hover {
  background: var(--white);
  color: var(--navy);
}

.button + .button, .button + a.button { margin-right: 8px; }

form .button { margin-top: 16px; }
.filters .button { margin-top: 0; }

.linkish {
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

main .linkish,
main .linkish.danger { color: var(--navy); text-decoration: underline; }

form.inline { display: inline; }

label { display: block; margin: 12px 0 4px; }

.input, input[type="text"], input[type="password"], input[type="date"], select, textarea {
  width: 100%;
  border: 1px solid var(--navy);
  padding: 10px 12px;
  font: inherit;
  color: var(--navy);
  background: var(--white);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.filters label { margin: 0; min-width: 180px; }
.filters .button { margin-bottom: 2px; }

.messages { list-style: none; padding: 0; }
.message {
  padding: 10px 12px;
  margin: 8px 0;
  border: 1px solid var(--navy);
  background: var(--white);
  color: var(--navy);
}
.message.success { background: var(--navy); color: var(--white); }
.field-error { color: var(--navy); font-weight: 700; margin: 4px 0 0; }
.errorlist { list-style: none; padding: 0; margin: 8px 0; color: var(--navy); font-weight: 700; }

.timeline { margin: 0; padding-right: 18px; }
.timeline li { margin: 12px 0; }
.plain { list-style: none; padding: 0; }
.plain li { margin: 8px 0; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(440px, calc(100% - 32px));
  background: var(--white);
  border: 1px solid var(--navy);
  padding: 28px;
}

.login-kicker {
  margin: 0 0 8px;
  font-size:1rem;
  font-weight: 400;
  opacity: 0.85;
}

.login-card h1 { font-size: 2rem; margin-bottom: 16px; }
.nowrap { white-space: nowrap; }

.hint {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--navy);
  color: var(--navy);
  font-size: 0.92rem;
  font-weight: 400;
}

.hint ul { padding-right: 18px; }

input.jalali-picker { display: none; }

.jalali-selects {
  display: grid;
  grid-template-columns: 1fr 1.3fr 0.8fr;
  gap: 8px;
}

#confirm-dialog {
  border: 1px solid var(--navy);
  padding: 24px;
  width: min(420px, calc(100% - 32px));
  color: var(--navy);
  background: var(--white);
}

#confirm-dialog::backdrop { background: rgba(7, 22, 51, 0.45); }

#confirm-dialog input {
  width: 100%;
  border: 1px solid var(--navy);
  padding: 10px 12px;
  font: inherit;
  color: var(--navy);
  background: var(--white);
}

.confirm-actions { display: flex; gap: 8px; margin-top: 16px; }

@media (max-width: 800px) {
  .grid, .heading, .split { display: block; }

  .bar {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 14px 0;
    gap: 12px;
  }

  .nav { flex-wrap: wrap; }
  .nav { margin: 0; }
  .nav a, .nav .linkish { margin: 0; }

  .filters { display: block; }
  .filters label { width: 100%; min-width: 0; margin-bottom: 12px; }
  .jalali-selects { grid-template-columns: 1fr; }

  table, thead, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }

  tr {
    border: 1px solid var(--navy);
    margin-top: 12px;
    padding: 4px 12px;
  }

  td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: 0;
    padding: 8px 0;
  }

  td::before {
    content: attr(data-label);
    font-weight: 700;
  }

  td[data-label=""]::before,
  td[colspan]::before { content: none; }

  tr:last-child td { border-bottom: 0; }
}
