.tam-front {
  --tam-ink: #12304f;
  --tam-brass: #c28a2c;
  --tam-brass-soft: #fbf1dd;
  --tam-teal: #0f766e;
  --tam-teal-soft: #dff4f1;
  --tam-text: #17212b;
  --tam-mut: #66788a;
  --tam-line: #e3e9ef;
  --tam-bg: #f3f6f9;
  --tam-red: #b42318;
  direction: rtl;
  text-align: right;
  color: var(--tam-text);
  font-size: 15px;
  line-height: 1.75;
  margin: 24px 0;
}
.tam-front *, .tam-front *::before, .tam-front *::after { box-sizing: border-box; }
.tam-front h2, .tam-front h3, .tam-front p, .tam-front dl, .tam-front dd { margin: 0; padding: 0; }
.tam-front button, .tam-front input, .tam-front select { font: inherit; }
.tam-front svg { flex: none; }
.tam-lock { overflow: hidden; }

/* hero */
.tam-hero {
  background: var(--tam-ink); color: #fff; padding: 36px 36px 78px; border-radius: 18px 18px 0 0;
  border-bottom: 4px solid var(--tam-brass);
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 2px, transparent 2px 14px);
}
.tam-hero h2 { font-size: 30px; font-weight: 800; line-height: 1.4; color: #fff; }
.tam-hero p { margin-top: 6px; color: rgba(255,255,255,.75); max-width: 560px; }

/* main card overlaps hero */
.tam-card {
  margin: -48px 16px 0; background: #fff; border: 1px solid var(--tam-line); border-radius: 16px;
  box-shadow: 0 18px 40px -18px rgba(18,48,79,.28); overflow: hidden; position: relative;
}
.tam-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--tam-line); }
.tam-tabs { display: inline-flex; background: var(--tam-bg); padding: 4px; border-radius: 11px; gap: 2px; }
.tam-tabs button { border: 0; background: transparent; padding: 7px 18px; border-radius: 8px; cursor: pointer; color: var(--tam-mut); font-weight: 700; transition: background .15s, color .15s; }
.tam-tabs button.on { background: #fff; color: var(--tam-ink); box-shadow: 0 1px 4px rgba(18,48,79,.15); }
.tam-find { position: relative; flex: 1 1 240px; display: block; }
.tam-find svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--tam-mut); }
.tam-front input[type=search] { width: 100%; height: 42px; border: 1px solid #cfd8e1; border-radius: 10px; padding: 0 14px 0 14px; padding-inline-start: 40px; background: #fff; color: var(--tam-text); box-shadow: none; }
.tam-front select { height: 42px; border: 1px solid #cfd8e1; border-radius: 10px; padding: 0 12px; background: #fff; color: var(--tam-text); min-width: 150px; }
.tam-front input:focus, .tam-front select:focus, .tam-tabs button:focus-visible, .tam-more:focus-visible, .tam-row:focus-visible {
  outline: 3px solid rgba(194,138,44,.5); outline-offset: 1px; border-color: var(--tam-brass);
}

/* rows (table layout) */
.tam-list { display: flex; flex-direction: column; }
.tam-row {
  display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr) auto;
  gap: 20px; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--tam-line);
  position: relative; cursor: pointer; transition: background .15s;
}
.tam-row:last-child { border-bottom: 0; }
.tam-row::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: transparent; transition: background .15s; }
.tam-row.t-tender:hover::before { background: var(--tam-teal); }
.tam-row.t-auction:hover::before { background: var(--tam-brass); }
.tam-row:hover { background: #fafcfe; }
.tam-row.is-featured { background: linear-gradient(90deg, rgba(251,241,221,.55), transparent 60%); }
.tam-row-head { cursor: default; padding-block: 11px; background: #f8fafc !important; color: var(--tam-mut); font-size: 13px; font-weight: 600; }
.tam-row-head::before { display: none; }

.tam-c { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tam-c small { color: var(--tam-mut); font-size: 12.5px; }
.tam-c-title { flex-direction: row; gap: 14px; align-items: flex-start; }
.tam-mark { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.t-tender .tam-mark { background: var(--tam-teal-soft); color: var(--tam-teal); }
.t-auction .tam-mark { background: var(--tam-brass-soft); color: #8a5d12; }
.tam-c-title h3 { font-size: 16px; font-weight: 800; line-height: 1.6; color: var(--tam-text); margin-top: 3px; }
.tam-c-title p { display: flex; align-items: center; gap: 6px; color: var(--tam-mut); font-size: 13px; }
.tam-c-title p svg { width: 15px; height: 15px; }
.tam-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tam-cat { color: var(--tam-mut); font-size: 12.5px; }
.tam-feat { display: inline-flex; align-items: center; gap: 4px; color: #8a5d12; font-size: 12.5px; font-weight: 700; }
.tam-amt { font-size: 18px; font-weight: 800; color: var(--tam-ink); line-height: 1.5; }
.tam-dash { color: #a5b2bf; }
.tam-left { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--tam-teal); margin-top: 2px; }
.tam-left.tam-urgent { color: var(--tam-red); }
.tam-meter { height: 5px; background: #e8edf2; border-radius: 99px; overflow: hidden; margin-top: 6px; max-width: 150px; }
.tam-meter i { display: block; height: 100%; background: var(--tam-teal); border-radius: 99px; }
.tam-left.tam-urgent ~ .tam-meter i { background: var(--tam-red); }

.tam-more { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--tam-line); background: #fff; color: var(--tam-ink); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 700; transition: background .15s, color .15s, border-color .15s; white-space: nowrap; }
.tam-row:hover .tam-more { background: var(--tam-ink); color: #fff; border-color: var(--tam-ink); }

/* badges */
.tam-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; width: fit-content; }
.tam-badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-tender { background: var(--tam-teal-soft); color: var(--tam-teal); }
.b-auction { background: var(--tam-brass-soft); color: #8a5d12; }
.s-open { background: #e3f6e8; color: #166534; }
.s-upcoming { background: #e1effe; color: #1d4ed8; }
.s-expired { background: #eceff3; color: #5b6b7b; }
.s-awarded { background: #efe7fb; color: #6b3fb0; }
.s-cancelled { background: #fdecea; color: var(--tam-red); }

/* footer / pager */
.tam-foot { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-top: 1px solid var(--tam-line); color: var(--tam-mut); font-size: 13px; }
.tam-foot:empty { display: none; }
.tam-pages { display: flex; align-items: center; gap: 4px; }
.tam-pages button { min-width: 36px; height: 36px; border: 1px solid var(--tam-line); background: #fff; border-radius: 9px; cursor: pointer; color: var(--tam-text); display: inline-flex; align-items: center; justify-content: center; }
.tam-pages button.on { background: var(--tam-ink); color: #fff; border-color: var(--tam-ink); }
.tam-pages button:disabled { opacity: .4; cursor: default; }

/* empty + skeleton */
.tam-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 56px 16px; color: var(--tam-mut); text-align: center; }
.tam-empty svg { color: #b6c3cf; margin-bottom: 6px; }
.tam-empty b { color: var(--tam-text); font-size: 16px; }
.tam-sk { height: 82px; margin: 14px 22px; border-radius: 12px; background: linear-gradient(90deg, #eef2f6 25%, #f7f9fb 50%, #eef2f6 75%); background-size: 200% 100%; animation: tam-sh 1.3s linear infinite; }
@keyframes tam-sh { to { background-position: -200% 0; } }

/* dialog */
.tam-pop { position: fixed; inset: 0; z-index: 99999; background: rgba(12,26,43,.6); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tam-pop[hidden] { display: none; }
.tam-dlg { position: relative; background: #fff; width: 100%; max-width: 720px; max-height: calc(100vh - 32px); border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.4); animation: tam-in .2s ease-out; }
@keyframes tam-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.tam-close { position: absolute; top: 14px; inset-inline-end: 14px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.tam-close:hover { background: rgba(255,255,255,.28); }
.tam-dlg-head { background: var(--tam-ink); color: #fff; padding: 26px 28px 22px; border-bottom: 4px solid var(--tam-brass); padding-inline-end: 64px; }
.tam-dlg-head h3 { font-size: 22px; line-height: 1.5; margin: 10px 0 4px; color: #fff; font-weight: 800; }
.tam-dlg-head p { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.75); }
.tam-dlg-body { padding: 22px 28px; overflow-y: auto; }
.tam-cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.tam-cd div { background: var(--tam-bg); border-radius: 12px; padding: 10px 6px; text-align: center; border: 1px solid var(--tam-line); }
.tam-cd b { display: block; font-size: 26px; line-height: 1.3; color: var(--tam-ink); font-weight: 800; }
.tam-cd span { font-size: 12.5px; color: var(--tam-mut); }
.tam-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--tam-line); border-radius: 12px; overflow: hidden; }
.tam-meta > div { padding: 12px 16px; border-bottom: 1px solid var(--tam-line); border-inline-start: 1px solid var(--tam-line); }
.tam-meta > div:nth-child(odd) { border-inline-start: 0; }
.tam-meta dt { color: var(--tam-mut); font-size: 12.5px; }
.tam-meta dd { font-weight: 600; }
.tam-meta dd strong { font-size: 17px; color: var(--tam-ink); }
.tam-desc { margin-top: 18px; line-height: 2; color: #2d3b49; }
.tam-dlg-foot { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 10px; padding: 14px 28px; border-top: 1px solid var(--tam-line); background: #f8fafc; }
.tam-dl { display: inline-flex; align-items: center; gap: 8px; background: var(--tam-brass); color: #fff !important; padding: 10px 20px; border-radius: 10px; font-weight: 700; text-decoration: none !important; box-shadow: 0 4px 14px rgba(194,138,44,.35); }
.tam-dl:hover { background: #ad7a22; }
.tam-ghost { border: 1px solid var(--tam-line); background: #fff; color: var(--tam-ink); padding: 10px 20px; border-radius: 10px; font-weight: 700; cursor: pointer; }

/* tablet / mobile: rows become cards */
@media (max-width: 900px) {
  .tam-row-head { display: none; }
  .tam-row { grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 18px; }
  .tam-c-title { grid-column: 1 / -1; }
  .tam-c[data-label]::before { content: attr(data-label); color: var(--tam-mut); font-size: 12px; }
  .tam-c-act { grid-column: 1 / -1; }
  .tam-more { width: 100%; justify-content: center; }
  .tam-row .tam-more { background: var(--tam-ink); color: #fff; border-color: var(--tam-ink); }
}
@media (max-width: 600px) {
  .tam-hero { padding: 26px 20px 70px; }
  .tam-hero h2 { font-size: 24px; }
  .tam-card { margin-inline: 8px; }
  .tam-bar > * { flex: 1 1 100%; }
  .tam-tabs button { flex: 1; }
  .tam-front select { width: 100%; }
  .tam-meta, .tam-cd { grid-template-columns: 1fr 1fr; }
  .tam-meta > div { border-inline-start: 0 !important; }
  .tam-dlg-head, .tam-dlg-body, .tam-dlg-foot { padding-inline: 18px; }
  .tam-dlg-foot { flex-direction: column; }
  .tam-dl, .tam-ghost { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .tam-dlg, .tam-sk { animation: none; }
  .tam-front * { transition: none !important; }
}
