/* سامانه سهام - طراحی مدرن RTL */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #1a4d7c;
  --primary-dark: #0f3460;
  --primary-light: #2a6cb0;
  --accent: #2d6a4f;
  --accent-light: #40916c;
  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --text: #1a2332;
  --text-muted: #5a6a7e;
  --border: #dde3ea;
  --border-light: #e8edf2;
  --success: #2d6a4f;
  --danger: #c0392b;
  --warning: #d68910;
  --shadow-sm: 0 1px 3px rgba(26, 77, 124, 0.08);
  --shadow-md: 0 4px 16px rgba(26, 77, 124, 0.12);
  --shadow-lg: 0 8px 32px rgba(26, 77, 124, 0.16);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header & Navigation ─── */
.site-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.brand-logo img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
}

.brand-text p {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.85;
  font-weight: 400;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

/* ─── Main Content ─── */
.main-content {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-title {
  text-align: center;
  margin-bottom: 2rem;
}

.page-title h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.page-title p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.card-header {
  background: linear-gradient(to left, var(--primary), var(--primary-light));
  color: #fff;
  padding: 1rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
}

.card-body {
  padding: 1.5rem;
}

/* ─── Search Form ─── */
.search-form-card {
  max-width: 520px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
}

.form-group label .required {
  color: var(--danger);
  margin-right: 0.2rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  text-align: right;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42, 108, 176, 0.15);
}

.form-control::placeholder {
  color: #aab4c0;
}

.form-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: #fff8e6;
  border: 1px solid #f0d78c;
  border-radius: var(--radius-sm);
  color: #8a6d1a;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  line-height: 1.4;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26, 77, 124, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  box-shadow: 0 4px 12px rgba(26, 77, 124, 0.35);
}

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--primary-light);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff;
}

/* ─── Alerts ─── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  text-align: center;
  font-weight: 500;
}

.alert-danger {
  background: #fdecea;
  color: var(--danger);
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #e8f5ee;
  color: var(--success);
  border: 1px solid #a8d5ba;
}

/* ─── Data Tables ─── */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
}

.data-table thead th {
  background: linear-gradient(to bottom, #e8eef5, #dde6f0);
  color: var(--primary-dark);
  font-weight: 600;
  padding: 0.85rem 1rem;
  text-align: center;
  border-bottom: 2px solid var(--primary);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 0.75rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.data-table tbody tr:hover {
  background: #eef4fb;
}

.data-table .label-cell {
  background: #f0f4f8;
  font-weight: 500;
  color: var(--text-muted);
  text-align: right;
  width: 35%;
  white-space: nowrap;
}

.data-table .value-cell {
  text-align: center;
  font-weight: 500;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: var(--accent);
  border-radius: 2px;
}

/* ─── Footer ─── */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.85);
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
}

.footer-brand {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #fff;
}

.footer-notes {
  font-size: 0.82rem;
  line-height: 1.8;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto;
}

.footer-notes p {
  margin: 0.5rem 0;
}

.footer-contact {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
}

.footer-contact a {
  color: #7ec8e3;
  text-decoration: none;
}

.footer-contact a:hover {
  text-decoration: underline;
}

.footer-logo {
  margin-top: 1.25rem;
  opacity: 0.7;
}

.footer-logo img {
  height: 32px;
  filter: brightness(0) invert(1);
  opacity: 0.6;
}

/* ─── Hero on home page ─── */
.hero-section {
  text-align: center;
  padding: 1rem 0 2rem;
}

.hero-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  box-shadow: var(--shadow-md);
}

/* ─── Result badge ─── */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-ok {
  background: #d4edda;
  color: #155724;
}

.badge-not {
  background: #f8d7da;
  color: #721c24;
}

/* ─── Back link ─── */
.back-bar {
  margin-bottom: 1.5rem;
}

/* ─── Report & Print ─── */
.report-printable {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.print-report-header {
  text-align: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary);
}

.print-report-header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.print-company {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.print-meta {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.print-footer-notes {
  display: none;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.print-footer-notes p {
  margin: 0.25rem 0;
}

.report-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2rem 0 1rem;
}

.btn-print {
  background: linear-gradient(135deg, #2c5282 0%, #3182ce 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(44, 82, 130, 0.3);
}

.btn-print:hover {
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
  box-shadow: 0 4px 12px rgba(44, 82, 130, 0.35);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    min-height: auto;
  }

  .brand-text h1 {
    font-size: 0.95rem;
  }

  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-bottom: 0.75rem;
  }

  .main-nav.open {
    display: flex;
  }

  .nav-link {
    width: 100%;
    justify-content: center;
    padding: 0.65rem;
  }

  .main-content {
    padding: 1.25rem 1rem;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table thead th,
  .data-table tbody td {
    padding: 0.6rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .report-actions {
    flex-direction: column;
  }
}

/* ─── A4 Print Layout ─── */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 12mm;
  }

  html, body {
    width: 210mm;
    height: auto;
    background: #fff !important;
    color: #000 !important;
    font-size: 10pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .site-header,
  .site-footer,
  .no-print,
  .page-title {
    display: none !important;
  }

  .main-content {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .report-printable {
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    page-break-inside: avoid;
  }

  .print-report-header {
    margin-bottom: 6mm;
    padding-bottom: 4mm;
    border-bottom: 1.5pt solid #1a4d7c;
  }

  .print-report-header h2 {
    font-size: 14pt;
    color: #000;
  }

  .print-company,
  .print-meta {
    font-size: 9pt;
    color: #333;
  }

  .print-footer-notes {
    display: block;
    margin-top: 5mm;
    font-size: 7.5pt;
  }

  .section-title {
    margin: 4mm 0 2mm;
    font-size: 10pt;
    color: #000;
    page-break-after: avoid;
  }

  .section-title::before {
    background: #2d6a4f;
  }

  .table-wrapper {
    overflow: visible;
    margin-bottom: 3mm;
    border: 0.5pt solid #bbb;
    border-radius: 0;
    box-shadow: none;
    page-break-inside: avoid;
  }

  .data-table {
    font-size: 8.5pt;
    page-break-inside: avoid;
  }

  .data-table thead th {
    background: #e8eef5 !important;
    color: #000 !important;
    padding: 2mm 2.5mm;
    border-bottom: 1pt solid #1a4d7c;
    font-size: 8pt;
  }

  .data-table tbody td {
    padding: 1.8mm 2.5mm;
    border-bottom: 0.5pt solid #ddd;
    color: #000;
  }

  .data-table tbody tr:nth-child(even),
  .data-table tbody tr:hover {
    background: #f5f7fa !important;
  }

  .data-table .label-cell {
    background: #f0f4f8 !important;
    color: #333;
    width: 32%;
    font-size: 8pt;
  }

  .data-table .value-cell {
    font-size: 8.5pt;
  }
}
