/*
 * MD-Tickets — custom styles
 * Built on top of Bootstrap 5.3 CDN.
 */

/* ── Root / brand colours ─────────────────────────────────────────────────── */
:root {
  --md-primary:    #2563EB;  /* blue-600 */
  --md-success:    #22c55e;  /* green-500 */
  --md-warning:    #f59e0b;  /* amber-500 */
  --md-danger:     #ef4444;  /* red-500 */
  --md-info:       #06b6d4;  /* cyan-500 */
  --md-muted:      #64748b;  /* slate-500 */
  --md-purple:     #8b5cf6;  /* violet-500 */
  --md-orange:     #f97316;  /* orange-500 */
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
body {
  min-height: 100vh;
  display:    flex;
  flex-direction: column;
  background: #f8fafc;
}

main {
  flex: 1;
}

/* ── Navbar refinements ───────────────────────────────────────────────────── */
.navbar-brand {
  font-size: 1.1rem;
  letter-spacing: .02em;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  border-radius: .75rem;
}
.card-header {
  border-radius: .75rem .75rem 0 0 !important;
  padding: .75rem 1.25rem;
}

/* ── Status badge colours ─────────────────────────────────────────────────── */
.status-badge {
  font-weight: 600;
  font-size:   .75rem;
  letter-spacing: .02em;
  border-radius: .375rem;
}

.status-OPEN                    { background: var(--md-warning);  color: #fff; }
.status-IN_PROGRESS             { background: var(--md-primary);  color: #fff; }
.status-WAIT_FOR_INFORMATION    { background: var(--md-orange);   color: #fff; }
.status-PROCESSED_BY_MD         { background: var(--md-purple);   color: #fff; }
.status-READY_FOR_RELEASE       { background: var(--md-info);     color: #fff; }
.status-COMPLETED               { background: var(--md-success);  color: #fff; }
.status-ALREADY_AVAILABLE       { background: var(--md-muted);    color: #fff; }

/* ── Sub-status badge colours ─────────────────────────────────────────────── */
.substatus-OPEN              { background: #e2e8f0; color: #334155; }
.substatus-DONE              { background: var(--md-success); color: #fff; }
.substatus-NOT_SELLABLE      { background: var(--md-danger);  color: #fff; }
.substatus-NO_LIST_PRICE_APPLICABLE { background: #a855f7; color: #fff; }
.substatus-EXCLUDE_FROM_PROD_SAFETY_CHECK { background: #14b8a6; color: #fff; }

/* ── Avatar circle ────────────────────────────────────────────────────────── */
.avatar-circle {
  display:     inline-flex;
  align-items: center;
  justify-content: center;
  width:  36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  font-weight: 600;
}

/* ── Form improvements ────────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
  border-color: var(--md-primary);
  box-shadow:   0 0 0 .2rem rgba(37, 99, 235, .2);
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.page-link {
  color: var(--md-primary);
}
.page-item.active .page-link {
  background-color: var(--md-primary);
  border-color:     var(--md-primary);
}

/* ── Timeline ─────────────────────────────────────────────────────────────── */
.timeline > div:not(:last-child) {
  padding-bottom: .5rem;
  border-left: 2px solid #e2e8f0;
  margin-left: 20px;
  padding-left: 1rem;
}

/* ── Utilities ────────────────────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.fs-xs          { font-size: .7rem !important; }

/* ── HTMX loading indicator ───────────────────────────────────────────────── */
.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms ease;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}

/* ── Responsive table scroll ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }
}
