/* Alamaze order entry */

.order-shell {
  max-width: 1500px;
}

/* ------------------------------------------------------------------ header */
.order-header {
  border: 0;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  background: #1f2426;
  color: #e9ecef;
}

.order-header .kingdom-name {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.15;
}

.order-header .game-meta {
  font-size: .8rem;
  color: #aab4b8;
}

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: .3rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .09);
  font-size: .8rem;
  white-space: nowrap;
}

.chip .chip-label {
  color: #9fb0b5;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .66rem;
}

.chip .chip-value {
  font-weight: 600;
  color: #f1f5f6;
}

.chip.chip-over {
  background: rgba(220, 53, 69, .22);
  border-color: rgba(220, 53, 69, .55);
}

.chip.chip-ok {
  background: rgba(40, 167, 69, .18);
  border-color: rgba(40, 167, 69, .45);
}

/* -------------------------------------------------------------------- tabs */
.order-tabs {
  position: sticky;
  top: 132px;
  z-index: 1010;
  padding: .4rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  background: #e9ecef;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
}

.order-tabs .nav-link {
  padding: .35rem .7rem;
  font-size: .86rem;
  font-weight: 600;
  color: #343a40;
  border-radius: 5px;
}

.order-tabs .nav-link .tab-count {
  display: inline-block;
  min-width: 1.35rem;
  padding: 0 .3rem;
  margin-left: .35rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, .12);
  font-size: .7rem;
  text-align: center;
}

.order-tabs .nav-link.active .tab-count {
  background: rgba(255, 255, 255, .28);
}

/* ------------------------------------------------------------ actor cards */
.actor-card {
  margin-bottom: .75rem;
  border: 1px solid #cfd6da;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.actor-card > .card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  padding: .4rem .65rem;
  background: #f4f6f7;
  border-bottom: 1px solid #dde3e6;
}

.actor-card.has-orders > .card-header {
  background: #e8f1f8;
}

.actor-abbr {
  display: inline-block;
  min-width: 2.4rem;
  padding: .1rem .35rem;
  border-radius: 4px;
  background: #2c3e50;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-align: center;
}

.actor-name {
  font-weight: 600;
  font-size: .92rem;
}

.actor-sub {
  font-size: .76rem;
  color: #6c757d;
}

.actor-loc {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  color: #495057;
  padding: .05rem .3rem;
  background: #fff;
  border: 1px solid #d6dde1;
  border-radius: 3px;
}

.actor-card .card-body {
  padding: .55rem .65rem;
}

/* ------------------------------------------------------------- order lines */
.order-line {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .28rem .65rem;
  font-size: .85rem;
  border-left: 3px solid transparent;
}

.order-line:nth-child(odd) {
  background: #fbfcfd;
}

.order-line.is-standing {
  border-left-color: #17a2b8;
}

.order-line.seq-flash {
  animation: seq-flash 1.2s ease-out;
}

@keyframes seq-flash {
  from { background: #fff3cd; }
  to { background: transparent; }
}

.order-line .line-seq {
  min-width: 1.6rem;
  font-size: .72rem;
  color: #8a969c;
  font-variant-numeric: tabular-nums;
}

.order-line .line-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  font-weight: 700;
  color: #0b5ed7;
  min-width: 2.1rem;
}

.order-line .line-title {
  font-weight: 600;
  white-space: nowrap;
}

.order-line .line-detail {
  min-width: 0;
  flex: 0 1 auto;
  color: #5b6a72;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-line .line-cols {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
  color: #7b8a91;
  white-space: nowrap;
}

.order-line .btn {
  padding: 0 .35rem;
  font-size: .75rem;
  line-height: 1.5;
}

.badge-so {
  background: #17a2b8;
  font-size: .62rem;
  letter-spacing: .05em;
  vertical-align: middle;
}

/* ---------------------------------------------------------------- add rows */
.add-row {
  background: #f8f9fa;
  border-top: 1px dashed #d8dfe3;
}

.add-row .form-control,
.add-row .custom-select {
  height: calc(1.4rem + 2px);
  padding: .1rem .4rem;
  font-size: .82rem;
}

.add-row label {
  margin-bottom: .1rem;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6c757d;
}

.add-row .param {
  min-width: 7rem;
}

.add-row .param-wide {
  min-width: 13rem;
  flex: 1 1 13rem;
}

.add-row .param-tiny {
  min-width: 4.5rem;
}

.add-row .actor-field {
  min-width: 8rem;
}

/* ---------------------------------------------------------------- summary */
.summary-table {
  font-size: .84rem;
}

.summary-table th {
  position: sticky;
  top: 0;
  background: #e9ecef;
  z-index: 2;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #495057;
}

.summary-table td,
.summary-table th {
  padding: .3rem .45rem;
  vertical-align: middle;
}

.summary-table .col-preview {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
  color: #6c757d;
  white-space: nowrap;
}

.summary-table tr.is-standing {
  background: #effafc;
}

.summary-table tr.row-error {
  background: #fdecea;
}

/* ------------------------------------------------------------------- map */
.order-map-card {
  border: 0;
  border-radius: 6px;
  background: #1f2426;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
}

.order-map-card > .card-header {
  background: #282e30;
  border-bottom: 1px solid #3a4246;
}

.order-map-card > .card-body {
  background: #fff;
}

.order-map-card .grid-limit {
  margin-left: auto;
  margin-right: auto;
}

.order-map-card .grid-layout {
  grid-template-columns: repeat(26, minmax(0, 1fr));
}

.order-map-card .grid-item {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: var(--map-aspect, 1 / 1);
  background-size: 2600% 2600% !important;
}

.order-map-card .icon_city,
.order-map-card .icon_group,
.order-map-card .icon_capital,
.order-map-card .icon_artifact {
  width: 75%;
  height: auto;
}

/* ------------------------------------------------------------------ misc */
.verify-panel {
  border-left: 4px solid #6c757d;
}

.verify-panel.is-ok {
  border-left-color: #28a745;
}

.verify-panel.is-error {
  border-left-color: #dc3545;
}

.verify-panel ul {
  margin-bottom: 0;
  padding-left: 1.1rem;
}

.empty-state {
  padding: 1.4rem;
  color: #6c757d;
  text-align: center;
  font-size: .9rem;
}

.raw-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: .35rem;
}

.raw-grid .raw-col label {
  font-size: .68rem;
  color: #6c757d;
  margin-bottom: 0;
}

.raw-grid .raw-col .form-control {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  padding: .15rem .3rem;
}

.raw-preview {
  padding: .5rem .6rem;
  background: #212529;
  color: #9fe8b1;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  white-space: pre;
  overflow-x: auto;
}

.order-toast {
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  z-index: 1080;
  min-width: 15rem;
  max-width: 26rem;
}

.saving {
  opacity: .55;
  pointer-events: none;
}

/* -------------------------------------------------------------- responsive */
@media (max-width: 767.98px) {
  .order-tabs {
    position: static;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .order-line {
    flex-wrap: wrap;
  }

  .order-line .line-cols {
    display: none;
  }

  .raw-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
