@import url("fontiran.css");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: "IRANSansNormal", Tahoma, "Segoe UI", sans-serif;
  background: #f4f6fa;
  color: #2c3345;
  line-height: 1.8;
}
a {
  color: #2456d6;
  text-decoration: none;
}
.topbar {
  background: #1f3a68;
  color: #fff;
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 {
  font-size: 1.2rem;
}
.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.topbar nav a {
  color: #cfe0ff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.95rem;
}
.topbar nav a.active,
.topbar nav a:hover {
  background: #3a5c9e;
  color: #fff;
}
.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}
.footer {
  text-align: center;
  padding: 24px;
  color: #8a93a6;
  font-size: 0.85rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.card {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.card-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1f3a68;
}

.panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.panel h2 {
  font-size: 1.1rem;
  margin-bottom: 14px;
  color: #1f3a68;
  border-bottom: 2px solid #eef1f7;
  padding-bottom: 8px;
}
.panel h3 {
  font-size: 1rem;
  margin-bottom: 14px;
  color: #1f3a68;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 800px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th,
td {
  border: 1px solid #e3e7f0;
  padding: 8px 10px;
  text-align: center;
}
thead th {
  background: #eef2fb;
  color: #1f3a68;
}
tbody tr:hover {
  background: #f8faff;
}
.table-wrap {
  overflow-x: auto;
}

input,
select,
button {
  font-family: inherit;
  font-size: 0.95rem;
}
input[type="text"],
input[type="time"],
select {
  padding: 8px 10px;
  border: 1px solid #cdd5e4;
  border-radius: 8px;
  background: #fff;
}
input:focus,
select:focus {
  outline: 2px solid #2456d6;
  outline-offset: 1px;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}
.form-col {
  display: flex;
  flex-direction: column;
  min-width: 180px;
  flex: 1;
}
.form-col label {
  font-size: 0.85rem;
  color: #556;
  margin-bottom: 4px;
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.chk {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn {
  display: inline-block;
  background: #2456d6;
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: background 0.15s;
}
.btn:hover {
  background: #1a41ab;
}
.btn.secondary {
  background: #6b7a99;
}
.btn.danger {
  background: #c0392b;
}
.btn.danger:hover {
  background: #96281b;
}
.btn.small {
  padding: 4px 10px;
  font-size: 0.82rem;
}
.btn.tiny {
  padding: 2px 8px;
  font-size: 0.75rem;
}
.actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
}
.actions form {
  display: inline;
}

.alert {
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 14px;
  background: #fff8e1;
  color: #7a5c00;
  border: 1px solid #f0dfa0;
}
.alert.success {
  background: #e8f6ec;
  color: #1e6b33;
  border-color: #b7e0c3;
}
.alert.danger {
  background: #fdeaea;
  color: #8f1f16;
  border-color: #f3b6b0;
}
.subtitle {
  color: #667;
  font-size: 0.9rem;
  margin-top: 6px;
}
.muted {
  color: #8a93a6;
}
.simple-list {
  list-style: none;
  margin-bottom: 10px;
}
.simple-list li {
  padding: 4px 0;
  border-bottom: 1px dashed #eee;
}

/* جدول برنامه هفتگی */
table.schedule td {
  min-width: 110px;
  vertical-align: top;
}
table.schedule td.filled {
  background: #f0f6ff;
}
table.schedule small {
  display: block;
  color: #556;
  font-size: 0.78rem;
}
.cell-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  justify-content: center;
}

/* نمودار میله‌ای */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bar-label {
  min-width: 130px;
  font-size: 0.85rem;
}
.bar-track {
  flex: 1;
  background: #eef1f7;
  border-radius: 6px;
  height: 18px;
  overflow: hidden;
}
.bar-fill {
  background: #2456d6;
  height: 100%;
  border-radius: 6px;
}
.bar-fill.secondary {
  background: #18a06a;
}
.bar-fill.empty {
  background: #c8d0e0;
}
.bar-val {
  min-width: 70px;
  text-align: left;
  font-size: 0.85rem;
  color: #556;
}
@media (max-width: 600px) {
  .bar-label {
    min-width: 90px;
  }
}

/* نمودار ساعتی (ستونی CSS) */
.hourly-chart {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 140px;
  margin-bottom: 6px;
}
.hour-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}
.hour-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}
.hour-bar {
  width: 100%;
  background: #4c7de0;
  border-radius: 4px 4px 0 0;
  min-height: 0;
}
.hour-label {
  font-size: 0.68rem;
  color: #778;
  margin-top: 4px;
}

/* مدت زمان */
.duration-badge {
  background: #eef2fb;
  border: 1px solid #cdd9f2;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 700;
  color: #1f3a68;
  display: inline-block;
}
.duration-badge.invalid {
  color: #c0392b;
  border-color: #f3b6b0;
}

/* Datepicker جلالی */
.jdp {
  position: absolute;
  z-index: 1000;
  background: #fff;
  border: 1px solid #cdd5e4;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  padding: 10px;
  width: 260px;
  font-family: inherit;
  direction: rtl;
  user-select: none;
}
.jdp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.jdp-header button {
  background: #eef2fb;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 10px;
  font-size: 0.9rem;
}
.jdp-title {
  font-weight: 700;
  color: #1f3a68;
}
.jdp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.jdp-dow {
  font-size: 0.72rem;
  color: #778;
  padding: 4px 0;
}
.jdp-day {
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.jdp-day:hover {
  background: #eef2fb;
}
.jdp-day.today {
  border: 1px solid #2456d6;
}
.jdp-day.selected {
  background: #2456d6;
  color: #fff;
}
.jdp-empty {
  visibility: hidden;
}
