/* ================= Local Vazirmatn Font ================= */
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --bg: #0c0d11;
  --card: #15161c;
  --card2: #1b1c24;
  --line: #2b2d3a;
  --gold: #d4af37;
  --gold2: #f3e098;
  --text: #f0f1f5;
  --muted: #9da1b2;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  padding: 30px 16px;
  direction: rtl;
  line-height: 1.85;
  background: radial-gradient(1200px 600px at 50% -10%, #1e1b12 0%, var(--bg) 65%);
  color: var(--text);
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, Tahoma, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--gold2);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

.panel-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(21, 22, 28, 0.94);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.panel-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 7px 14px;
  border-radius: 9px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.panel-nav a:hover,
.panel-nav a.active {
  color: #15130c;
  background: linear-gradient(68deg, var(--gold) 14%, var(--gold2) 65%);
}

.panel-nav a:last-child {
  margin-right: auto;
}

@media (max-width: 650px) {
  .panel-nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .panel-nav a:last-child {
    margin-right: 0;
  }
}

.card {
  background: linear-gradient(180deg, var(--card) 0%, #111217 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
}

.brand {
  color: var(--gold);
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  margin-bottom: 8px;
}

h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  text-align: center;
}

.sub {
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  margin: 0 0 24px;
}

label {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  margin: 16px 0 6px;
}

input[type=tel], input[type=text] {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0d0e12;
  color: var(--text);
  font-size: 16px;
  outline: none;
  font-family: inherit;
  letter-spacing: 1px;
  text-align: center;
  direction: ltr;
  transition: all 0.2s ease;
}

input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.code-input {
  letter-spacing: 10px;
  font-size: 24px;
  font-weight: 700;
}

.btn {
  width: 100%;
  margin-top: 20px;
  padding: 13px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--gold) 0%, #b8912b 100%);
  color: #121004;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.link-btn {
  background: none;
  border: 0;
  color: var(--gold);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.2s;
}

.link-btn:hover {
  color: var(--gold2);
}

.link-btn:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.timer {
  color: var(--muted);
  font-size: 13px;
}

.msg {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid transparent;
}

.msg.ok {
  background: rgba(39, 174, 96, 0.12);
  border-color: rgba(39, 174, 96, 0.4);
  color: #8ff0b8;
}

.msg.err {
  background: rgba(231, 76, 60, 0.12);
  border-color: rgba(231, 76, 60, 0.4);
  color: #ffb3ab;
}

.hidden {
  display: none !important;
}

/* ================= Dashboard Specific Styles ================= */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.top h1 {
  text-align: right;
  font-size: 21px;
  font-weight: 700;
  margin: 0;
}

.top .who {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 4px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 20px 0 26px;
}

.stat {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  transition: transform 0.2s;
}

.stat:hover {
  transform: translateY(-2px);
}

.stat .n {
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
}

.stat .t {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.profile {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 26px;
}

.profile h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--gold);
}

.submission-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
}

.submission-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  text-align: right;
  font-size: 13px;
}

.submission-table th,
.submission-table td {
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}

.submission-table th {
  color: var(--gold2);
  background: #1b1c24;
  font-size: 12px;
  font-weight: 700;
}

.submission-table tbody tr {
  transition: background .2s;
}

.submission-table tbody tr:hover {
  background: rgba(212, 175, 55, .035);
}

.submission-table tbody tr:last-child td {
  border-bottom: 0;
}

.submission-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.work-title {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-date {
  color: var(--muted);
  font-size: 12px;
}

.table-details {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
}

.table-details summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  padding: 6px 10px;
  color: #111;
  background: linear-gradient(68deg, var(--gold) 14%, var(--gold2) 65%);
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
  list-style: none;
}

.table-details summary::-webkit-details-marker { display: none; }

.file-menu,
.detail-menu {
  min-width: 220px;
  margin-top: 10px;
  padding: 12px;
  background: #101116;
  border: 1px solid var(--line);
  border-radius: 10px;
  white-space: normal;
}

.file-menu {
  display: grid;
  gap: 7px;
}

.file-menu a {
  display: block;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12px;
}

.detail-menu {
  display: grid;
  gap: 8px;
  line-height: 1.7;
}

.detail-menu span {
  margin-left: 5px;
  color: var(--muted);
}

.synopsis-cell {
  max-width: 320px;
}

.locked-note {
  color: var(--muted);
  font-size: 11px;
}

.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 20px;
}

.pitem {
  font-size: 14px;
}

.pitem .k {
  color: var(--muted);
  margin-inline-end: 8px;
}

/* کارت هر اثر */
article.sub {
  background: linear-gradient(180deg, var(--card2) 0%, #14151a 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 16px;
  text-align: right;
  transition: border-color 0.2s;
}

article.sub:hover {
  border-color: rgba(212, 175, 55, 0.4);
}

.sub-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.sub-head h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.meta {
  font-size: 13px;
  color: var(--muted);
}

.code {
  color: var(--gold2);
  font-family: inherit;
  font-weight: 600;
  direction: ltr;
  display: inline-block;
}

.copy {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 2px 10px;
  cursor: pointer;
  font-family: inherit;
  margin-inline-start: 6px;
  transition: all 0.2s;
}

.copy:hover {
  color: var(--gold);
  border-color: var(--gold);
}

.badge {
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge-pending {
  background: rgba(230, 167, 0, 0.12);
  color: #ffd766;
  border-color: rgba(230, 167, 0, 0.35);
}

.badge-approved {
  background: rgba(39, 174, 96, 0.12);
  color: #7fe3a8;
  border-color: rgba(39, 174, 96, 0.35);
}

.badge-rejected {
  background: rgba(231, 76, 60, 0.12);
  color: #ff9c92;
  border-color: rgba(231, 76, 60, 0.35);
}

.sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 18px;
  margin-top: 14px;
  font-size: 13.5px;
}

.sub-grid .k {
  color: var(--muted);
  margin-inline-end: 6px;
}

details {
  margin-top: 16px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--gold);
  font-size: 13.5px;
  font-weight: 600;
  outline: none;
}

summary:hover {
  color: var(--gold2);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 14px;
  font-size: 13.5px;
}

.files a {
  display: inline-block;
  margin: 4px 6px 4px 0;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s;
}

.files a:hover {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
  background: var(--card2);
  border: 1px dashed var(--line);
  border-radius: 18px;
  font-size: 14.5px;
}

.logout {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  transition: all 0.2s;
}

.logout:hover {
  color: #ff9c92;
  border-color: rgba(231, 76, 60, 0.5);
  background: rgba(231, 76, 60, 0.08);
}

@media (max-width: 640px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.container-login { max-width: 430px; }
.row-center { justify-content: center; }
.space-top { margin-top: 10px; }
.section-title { font-size: 16px; color: var(--gold); margin: 0 0 12px; }
.top-actions, .submission-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-page { max-width: 850px; }
.edit-form { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid label { display: grid; gap: 7px; color: var(--muted); }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; padding: 11px 12px; background: #0b0c10; border: 1px solid var(--line); border-radius: 8px; color: #fff; }
.form-grid textarea { min-height: 150px; resize: vertical; }
.full-field { grid-column: 1 / -1; }
.form-alert { padding: 12px 14px; border-radius: 9px; margin-bottom: 14px; }
.form-alert.error { color: #fecaca; background: rgba(239,68,68,.14); border: 1px solid #7f1d1d; }
.form-alert.success { color: #bbf7d0; background: rgba(34,197,94,.12); border: 1px solid #166534; }
.form-note { color: var(--muted); font-size: 13px; margin: 10px 0; }
.btn-small { width: auto; padding: 7px 12px; font-size: 12px; }
.attachment-title { margin-top: 24px; }
.file-edit-grid { margin-bottom: 18px; }
.file-edit-grid input[type=file] { display: block; }
.current-file { font-size: 12px; font-weight: 600; }
@media (max-width: 650px) { .form-grid { grid-template-columns: 1fr; } .full-field { grid-column: auto; } }
