// ============================================================
// NPC SHEET — layout, vitals, skills, traits
// ============================================================

.oathhammer .npc-main {
  .npc-left {
    min-width: @npc-left-width;
    max-width: @npc-left-width;
    flex-shrink: 0;

    .actor-img {
      width: 100%;
      height: 170px;
      object-fit: cover;
      object-position: center top;
    }
  }

  .npc-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
  }

  // Name row
  .character-name {
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid @color-olive;
    padding-bottom: 4px;

    input {
      flex: 1;
      font-family: @font-primary;
      font-size: @font-size-lg;
    }
  }

  // Vitals: 2×2 grid (Grit | Defense / Armor | Movement)
  .npc-vitals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px 10px;
    padding: 4px 6px;
    border: 1px solid @color-olive;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.08);

    .npc-vital {
      display: flex;
      align-items: center;
      gap: 4px;

      .vital-label {
        font-family: @font-secondary;
        font-size: @font-size-sm;
        font-weight: bold;
        color: @color-dark;
        white-space: nowrap;
        min-width: 4.5rem;
      }

      .vital-roll-label {
        cursor: pointer;
        color: @color-blue;
        transition: color 0.15s;
        i { margin-right: 2px; font-size: 0.75rem; }
        &:hover { color: @color-gold; text-decoration: underline; }
      }

      .vital-value {
        display: flex;
        align-items: center;
        gap: 3px;
        flex: 1;

        div.form-group { display: contents; }

        input, .npc-num-input {
          width: 2.8rem;
          text-align: center;
          font-size: @font-size-sm;
          padding: 1px 2px;
        }

        .res-sep { opacity: 0.6; font-size: @font-size-xs; }
      }
    }

    .npc-vital-grit .vital-value {
      .grit-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1.2rem;
        height: 1.2rem;
        font-size: 0.85rem;
        font-weight: bold;
        line-height: 1;
        border: 1px solid @color-olive;
        border-radius: 3px;
        background: @color-olive-faint;
        color: @color-dark;
        cursor: pointer;
        user-select: none;
        flex-shrink: 0;
        &:hover { background: @color-gold; border-color: @color-gold; }
      }
    }
  }

  // Statistics fieldset grid
}

// Inline color badge (emoji in play mode)
.oathhammer .npc-color-badge {
  font-size: 0.85rem;
  flex-shrink: 0;
  line-height: 1;
}

// Inline color dropdown (in edit mode) — fixed width so it doesn't stretch the grid
.oathhammer .npc-color-select {
  width: 88px;
  max-width: 88px;
  flex-shrink: 0;
  font-size: @font-size-xs;
  padding: 0 2px;
  height: 20px;
  min-width: 0;
}

// Subtype badge (play mode) / select (edit mode)
.oathhammer .npc-subtype-badge {
  font-size: @font-size-base;
  font-weight: 600;
  color: @color-dark;
  background: fade(@color-gold, 20%);
  border: 1px solid fade(@color-gold, 50%);
  border-radius: 3px;
  padding: 1px 8px;
}

.oathhammer .npc-subtype-select {
  font-size: @font-size-sm;
  padding: 0 2px;
  height: 20px;
  min-width: 80px;
}

// ============================================================
// NPC SKILLS TAB
// ============================================================

// Color emoji indicator per dice type
.oathhammer .npc-skill-color {
  font-size: 0.95rem;
  text-align: center;
  line-height: 1;
  justify-self: center;
}
.oathhammer .npc-skill-color-white { opacity: 0.75; }
.oathhammer .npc-skill-color-red   { color: #cc4444; }
.oathhammer .npc-skill-color-black { color: #333; font-weight: bold; }

// Roll button in skill list
.oathhammer .npc-skill-roll-btn {
  color: @color-gold;
  padding: 2px 4px;
  border: 1px solid fade(@color-gold, 40%);
  border-radius: 3px;
  font-size: @font-size-sm;
  text-align: center;
  justify-self: center;
  &:hover { background: fade(@color-gold, 15%); }
}

// ============================================================
// NPC TRAITS TAB
// ============================================================

// Type badge used in traits list
.oathhammer .npc-trait-type-badge {
  font-size: 0.72rem;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  background: fade(@color-gold, 15%);
  border: 1px solid fade(@color-gold, 35%);
  color: @color-dark;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

// ============================================================
// NPC SKILL DIALOG
// ============================================================

.npc-skill-dialog {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}


// ============================================================
// REGIMENT ACTOR SHEET overrides
// ============================================================

// Regiment uses the same .npc-main structure but split into 2 rows
.oathhammer .npc-main .regiment-vitals-grid {
  &.regiment-row1 { grid-template-columns: 1fr 1fr 1fr; }
  &.regiment-row2 {
    grid-template-columns: 1fr 1fr 1fr;
    border-top: none;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed fade(@color-olive, 50%);
  }
}

// Regiment portrait — same dimensions as settlement sheet
.oathhammer .regiment-content .npc-left {
  min-width: 94px;
  max-width: 94px;

  .actor-img {
    width: 94px;
    height: 110px;
    object-fit: cover;
    object-position: center top;
    border: 2px solid fade(@color-dark, 40%);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    flex-grow: 0;
  }
}

// Regiment fieldset — remove default fieldset border for clean header look
.oathhammer .regiment-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

// ── Regiment leader row ───────────────────────────────────────
.oathhammer .regiment-leader-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  padding: 4px 6px;
  border: 1px dashed fade(@color-olive, 60%);
  border-radius: 3px;
  background: rgba(0,0,0,0.04);
  min-height: 28px;

  .regiment-leader-label {
    font-family: @font-secondary;
    font-size: @font-size-sm;
    font-weight: bold;
    color: @color-dark;
    white-space: nowrap;
    min-width: 5.5rem;
  }

  .regiment-leader-img {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    border: 1px solid @color-olive;
    object-fit: cover;
    flex-shrink: 0;
  }

  .regiment-leader-name {
    flex: 1;
    font-family: @font-secondary;
    font-size: @font-size-sm;
    color: @color-blue;
    font-weight: 600;
    cursor: pointer;
    &:hover { text-decoration: underline; color: @color-gold; }
  }

  .regiment-leader-empty {
    flex: 1;
    font-size: @font-size-xs;
    color: fade(@color-dark, 45%);
    font-style: italic;
  }

  .regiment-leader-clear {
    color: fade(@color-dark, 40%);
    font-size: @font-size-sm;
    cursor: pointer;
    flex-shrink: 0;
    &:hover { color: #cc3333; }
  }
}
